Will svn delete --keep-local also keep the file from being removed on update?

蓝咒 提交于 2020-02-24 11:58:13

问题


I've seen plenty of great answers on SO about using svn delete with the --keep-local flag to keep the file locally while deleting it in the repository. Unfortunately, I'm unable to find any information on whether the file will be removed from co-workers machines when they update because the file has been deleted from svn.

We have a project where the eclipse .project and some .settings files have been committed. We don't want that, so I'm attempting to remove them. If I do an svn delete --keep-local on the .project file, then I'm sure it'll keep it on my system, but will it wipe it out on the systems of my co-workers, thereby killing their eclipse project?

Optionally, is there a way for me to svn:ignore a versioned file without having to remove it from source control first?


回答1:


A quick test on my machine tells me that the file will be deleted from the other computers. Here I create a repository in directory repo and two working copies a and b. Then I create and commit a file in a, update b, delete --keep-local the file in b and finally update a. The file in a gets deleted. Sorry about the untranslated svn messages.

me@mycomp:~/Escritorio/test$ mkdir repo
me@mycomp:~/Escritorio/test$ svnadmin create repo
me@mycomp:~/Escritorio/test$ mkdir a 
me@mycomp:~/Escritorio/test$ mkdir b
me@mycomp:~/Escritorio/test$ svn co file:///`pwd`/repo a
Revisión obtenida: 0
me@mycomp:~/Escritorio/test$ svn co file:///`pwd`/repo b
Revisión obtenida: 0
me@mycomp:~/Escritorio/test$ cd a
me@mycomp:~/Escritorio/test/a$ ls
me@mycomp:~/Escritorio/test/a$ touch file
me@mycomp:~/Escritorio/test/a$ svn add file
A         file
me@mycomp:~/Escritorio/test/a$ svn ci -m "Adding file"
Añadiendo      file
Transmitiendo contenido de archivos .
Commit de la revisión 1.
me@mycomp:~/Escritorio/test/a$ cd ..
me@mycomp:~/Escritorio/test$ cd b
me@mycomp:~/Escritorio/test/b$ ls
me@mycomp:~/Escritorio/test/b$ svn up
A    file
Actualizado a la revisión 1.
me@mycomp:~/Escritorio/test/b$ svn delete --keep-local file 
D         file
me@mycomp:~/Escritorio/test/b$ svn commit -m "Deleting file"
Eliminando     file
Commit de la revisión 2.
me@mycomp:~/Escritorio/test/b$ cd ..
me@mycomp:~/Escritorio/test$ cd a
me@mycomp:~/Escritorio/test/a$ ls
file
me@mycomp:~/Escritorio/test/a$ svn update
D    file
Actualizado a la revisión 2.
me@mycomp:~/Escritorio/test/a$ ls
me@mycomp:~/Escritorio/test/a$



回答2:


You want to do an Ignore instead, preferably by file extension. This will delete the file from the repository, but it will not delete from your PC or other developers' PCs. I have to do this all the time when other developers add and commit Visual Studio local files (.user, etc.)



来源:https://stackoverflow.com/questions/5490228/will-svn-delete-keep-local-also-keep-the-file-from-being-removed-on-update

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