Losing SVN history on files during refactoring

后端 未结 3 757
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 00:20

During some refactoring, I\'m moving files around. Obviously SVN sees this as deleting the file and creating a new one since the IDE doesn\'t trigger an SVN rename/move operatio

3条回答
  •  我在风中等你
    2021-02-02 01:03

    The SVN way to do this is actually to have SVN rename the file (svn move or using TortoiseSVN's "Rename"). However, if you absolutely must have some external tool to perform the rename operation, you can use TortoiseSVN to repair the move operation. The following will tell SVN that the new file is actually the renamed old one:

    1. Open the "Check for Modifications" Window.
    2. Mark both the old file name (listed as missing) and the new one (listed as unversioned)
    3. Right click this selection and chose "Repair Move".

    Note: I'm typing this from memory. It might not be fully correct. And there might be other ways to do this (like marking the files in the explorer).

    If you already lost the history on a file where you miss it badly, you could resurrect the old file (you do this by svn copying an old revision's version into its old place), merge the new file's history into it, then delete the new file, and svn move the old file to the new file's name.

提交回复
热议问题