开发者

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

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 d开发者_C百科elete --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?


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$


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜