小编use*_*277的帖子

仅从工作副本中删除文件,但不从存储库中删除

由于我无法在网络的任何地方找到上述问题的答案,因此我自己来找解决方案.这是一个手动过程,但我找不到任何其他标准解决方案.所以这里是:

假设您要从目录工作中删除文件test.txt.现在,如果你强行删除test.txt

rm -rf test.txt

然后命令在工作目录(或其任何父目录)上的下一个svn上,该文件将被恢复.所以诀窍是从.svn/entries文件中删除它.因此,仅从工作副本中删除test.txt的完整命令序列是:

cd work
rm -rf test.txt
svn st     #it shows ! sign beside test.txt which means that 
       #in the next **svn up** it will be restored
chmod u+w .svn/entries
vi .svn/entries
#delete the lines associated with test.txt
#you need to delete the following 3 lines from .svn/entries
#test.txt
#file
#^L
svn st #it doesn't report test.txt anymore
Run Code Online (Sandbox Code Playgroud)

svn

6
推荐指数
2
解决办法
7411
查看次数

标签 统计

svn ×1