Reputation: 33422
To commit some changes to a git repo I must add it to the staged state first. If I don't add a file to commit it will not go to the repo.
But in SVN, apparently, there is no such staging state. And every change I made to my working copy goes to the repo with next svn commit. How can I prevent some locally changed files get commited without reverting the changes?
Upvotes: 13
Views: 2864
Reputation: 4080
You can give specific filenames and directories to svn commit via something like:
svn commit myfile.c
which will only commit that one file.
Upvotes: 1
Reputation: 993095
The svn commit
command takes optional filename parameters that limit the set of files to commit:
svn commit -m "my commit" file1.txt file2.txt
You can also use the "changelist" feature to group one or more files into a changelist, which can be submitted in one command. This is still slightly less flexible than Git, because you can't add just a portion of a single file (such as with git add -p
).
Upvotes: 14