svn “git add” alternative?

∥☆過路亽.° 提交于 2020-01-14 07:24:34

问题


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?


回答1:


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).




回答2:


You can give specific filenames and directories to svn commit via something like:

svn commit myfile.c

which will only commit that one file.



来源:https://stackoverflow.com/questions/5817316/svn-git-add-alternative

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!