Moving Directories with History

2019-01-10 12:10发布

I have a SVN structure like this:

/Projects
    /Project1
    /Project2
/someFolder
    /Project3
    /Project4

I would like to move all the projects into the /Projects folder, which means I want to move Projects 3 and 4 from /someFolder into the /projects folder.

The caveat: I'd like to keep the full history. I assume that every client would have to check out the stuff from the new location again, which is fine, but I still wonder what the simplest approach is to move directories without completely destroying the history?

Subversion 1.5 if that matters.

标签: svn
9条回答
叼着烟拽天下
2楼-- · 2019-01-10 12:38

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)

查看更多
smile是对你的礼貌
3楼-- · 2019-01-10 12:41

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

查看更多
我只想做你的唯一
4楼-- · 2019-01-10 12:46

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.

查看更多
一纸荒年 Trace。
5楼-- · 2019-01-10 12:52
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.

查看更多
Deceive 欺骗
6楼-- · 2019-01-10 12:54
svn help rename

Moving/renaming in subversion keeps history intact.

查看更多
迷人小祖宗
7楼-- · 2019-01-10 12:54

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.

查看更多
登录 后发表回答