SVN:如何在提交时忽略修改过的文件? [英] SVN: How to ignore a modified file on commit?
问题描述
我在 svn 中编辑了一些文件,如下所示:
I edited some files in svn, like this:
$svn st
M a
M b
...
现在,我想将我的更改提交到svn,出于某种原因,我不想提交文件b
,是否有任何快速的方法或命令可以忽略修改后的文件b
?
Now, I want to commit my changes to svn, for some reason, I don't want to commit file b
, is there any quick way or command to ignore the modified file b
?
最后,我使用@yzucker 解决方案 1,cp,还原并提交.更改列表太重了,谢谢大家.
Finally, I use @yzucker Solution 1, cp, revert and commit. Changelists is too heavy, thank you all.
推荐答案
唉,提交了许多文件,并忽略了一些烦人的更改.
Alas, the commit many files with some annoying changes ignored problem.
解决方案 1:复制、还原和提交
Solution 1: copy, revert and commit
$cp b /tmp/
$svn revert b
$svn commit -m 'commit message'
$mv /tmp/b ./
方案二:复制,提交,反转b的效果,重新提交b
Solution 2: copy, commit, reverse the effect of b, recommit b
$cp b /tmp/
$svn commit -m 'commit message'
$svn merge -c -{new revision} b
$svn commit b -m 'revert message for b'
$cp /tmp/b ./b
第二种方法不太可取,因为您在 svn 中引入了损坏的代码.
The second approach is less preferable since you introduce broken code in svn.
这篇关于SVN:如何在提交时忽略修改过的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!