"git add"相当于SVN? [英] "git add" equivalent in svn?
问题描述
要对git repo进行一些更改,我必须先将其添加到暂存状态.如果我不添加要提交的文件,它将不会进入存储库.
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.
但是,在SVN中,显然没有这种暂存状态.我对工作副本所做的每项更改都会在下次svn commit时进入回购协议.如何防止某些本地更改的文件提交而不恢复更改?
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?
推荐答案
svn commit
命令采用可选的文件名参数,这些参数限制了要提交的文件集:
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
您还可以使用变更列表"功能将一个或多个文件分组到一个更改列表中,可以通过一个命令提交.这仍然比Git灵活一些,因为您不能仅添加单个文件的一部分(例如,使用git add -p
).
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
).
这篇关于"git add"相当于SVN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!