Using Subversion, how can I cut from one file and paste to another preserving history

前端 未结 4 715
长情又很酷
长情又很酷 2021-02-04 07:20

The situation is that I\'ve spent some time messing around with some experimental code. I now want to move part of that code - about 500 lines - into another file, but I don\'t

4条回答
  •  醉梦人生
    2021-02-04 07:54

    I don't think you can preserve history in the way you are describing. SVN keeps track of history on a file-by-file basis, and it won't keep track of two separate files that are combined together on the same code line.

    If you started out with two separate files and then combine them together into a third, then the history of both will be preserved. If you combine one into the other, then the history of one of them will be "lost" in the sense that you won't be able to link back to the history of the "deleted" file just from looking at the history.

    I guess what you could do is in the commit message just note that the content from the other file was combined and then commit the delete in the same commit.

提交回复
热议问题