Grab revisions from SVN and merge with git repository?
I have an SVN branch with several commits that I want to export and merge into a git repository based on the same code (but without the changes). How do I do that?
I have tried creating a new git repo using git svn and then merging to git repos together, but that marked every single line in conflicting files as a conflict. Can I force it to run a proper diff instead of just marking everything as a conflict?
Update. I ended up creat开发者_运维百科ing a branch and copy-pasting files from svn there, then did a merge with another branch. Nasty, but it worked.
You're going to need to read a lot of documentation, but I can try to point you in the right direction. At least, I hope it's the right direction...
After creating the git repository using git svn
, you can use git fetch
to bring the svn changes into the git repository as its own branch. Then, you can use git filter-branch --parent-filter
to set the appropriate svn commit's parent to the appropriate git commit. Then, you can use git rebase
to clean up the commits, if necessary.
精彩评论