Keeping revision history from before copy/rename in svn -> git
I recently moved an SVN repository into Git (following http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/) but fou开发者_Python百科nd a bit of a limitation - some of the files being imported have a long history prior to a SVN copy, but doing a git log --follow on any of these files only gives the history after the copy.
Is there a way of importing from SVN to Git that includes a revision history that follows SVN Copy/Rename?
Git doesn't store info about copies explicitly, so it's not a matter of how you import it, you have to tell it to detect them when you do the log command if you want it. From the git-log
man page:
-C[<n>]
--find-copies[=<n>]
Detect copies as well as renames. See also --find-copies-harder. If n is specified,
it has the same meaning as for -M<n>.
--find-copies-harder
For performance reasons, by default, -C option finds copies only if the original file
of the copy was modified in the same changeset. This flag makes the command inspect
unmodified files as candidates for the source of copy. This is a very expensive
operation for large projects, so use it with caution. Giving more than one -C option
has the same effect.
精彩评论