tags:

views:

81

answers:

2

i have checked out files from my svn repository to a local project folder.

then i add 1 file in the project folder but when i run

svn commit -m "added a file"

it doesnt commit anything! only when i change in the original files, not adding new ones.

how comes? cause i want it to add new files to the repository.

thanks!

+6  A: 

Try running svn add

From command line:

svn add  [newfiles]

first

Then

svn commit -m "added a file"

If you are using Tortoise svn (for windows), you need to right click the file(s) and choose TortoiseSVN->Add....

here

eclipse and netbeans data.

If you are using Subclipse (svn plugin for eclipse), when you try to commit, you'll see some checkboxes on the bottom part of the window. Any files with the + simbol there will be added + commited.

alt text

For netbeans, see here

alt text

Tom
+4  A: 

SVN doesn't know that you've added a file unless you tell it with the svn add command. Rather it doesn't know that you want a new file added to the repository until you do that.

I think that they chose this method of working because there are often a lot of files in a workspace that aren't intended to be in the repository. This makes users be explicit about what should go in.

svn status will let you know about new files that haven't been marked for adding to the repository.

Michael Burr
if i add a file in netbeans/eclipse, does SVN knows that when i commit?
never_had_a_name
@ajsie: Sorry, but I'm not familiar at all with how well NetBeans or Eclipse integrate with SVN.
Michael Burr
$michael: so what IDE are u using for svn?
never_had_a_name
you have to manually add anything to svn regardless of your IDE
fuzzy lollipop
@ajsie: of late I've been doing my SVN work outside the IDE from the command line and using TortoiseSVN. The SVN integration the IDE I'm using most of the time is painfully slow, so I didn't use it for more than a few moments.
Michael Burr
@fuzzy: isn't that up to the IDE's version control client? I'm not using IDE integration at the moment, but I'd fully expect that if I were and I added a file to the IDE's project that the IDE would automatically add that file to version control at the next commit (or at least offer to add it).
Michael Burr