Moving Directories with History

China☆狼群 提交于 2019-11-27 11:25:16
svn help rename

Moving/renaming in subversion keeps history intact.

Geekygecko
svn move SRC DST
$ svn move -m "Move a file" http://svn.red-bean.com/repos/foo.c http://svn.red-bean.com/repos/bar.c

svn move will keep your history.

Tortoise SVN supports 'Right Click' move. When you drag the source file/directory into the destination using 'mouse right click' a context menu will appear. You can select the appropriate menu option for copy/move/move-rename etc. This option will preserve the history as well.

Note: There is a nice fature called 'Repair Move' in Tortoise SVN - by using this feature you can rename the file/directory when you move it. (Refer to Documentation for more details)

If you move Project 3 into the project folder using the svn move command the history will be preserved for the Project 3 folder but interestingly the Projects folder will not show the history of Project 3 that was created before Project 3 was moved into Projects.

I find this confusing, I thought a folder would show all history below itself in the hierachy but it seems like this is not the case (just tested this myself)

You can use the svn copy command. It keeps your history. You just have to deselect the Option "Stop on copy/rename" while showing the Log (Example for Tortoise).

Take a closer look at the Subversion-Book svn copy

Drag-drop it using the repo-browser and rebind your local folder to your SVN server.

Moving directories in Subversion doesn't destroy history, AFAIK.

IN order to do that, you'll have to use svn's specific move/rename functions (check TortoiseSVN help if you use this for example). If you move the files by yourself and then commit the changes i'm not sure that history will be kept.

As far as I know, only Bazaar allow to keep history on directories, espacially when talking about moving directories. SVN allows you to keep history when moving files, but not directories.

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