I previously used GitHub’s import feature to convert an SVN repository to Git. The imported Git repo has no SVN connection or git-svn metadata in the commits.
After the import, new commits were added to the original SVN repository. Now I need to bring those SVN changes into my Git repository while keeping the existing Git history intact.
I attempted using git-svn but it cannot recognize the shared history between the SVN source and the GitHub-imported Git repo. The format-patch approach might work but I’m hoping for a more streamlined solution.
Key requirements:
- Preserve existing Git commit history (no rebasing)
- Keep commits identical to SVN versions (no additional svn-id metadata)
- Merge only the new SVN commits that happened after the initial import
What’s the best approach to sync these repositories while meeting these constraints?
yea, that sounds like a good plan! just make sure to test it out on a backup first, it can get messy. and don’t forget about checking the commit dates to keep them aligned with svn’s history, gl!
I faced a similar issue while transitioning a project from SVN to Git. To tackle it, I created a temporary git-svn clone of the SVN repository, which allowed me to effectively bridge the two systems. First, you should run git svn clone on the SVN repository to establish this connection. Once that’s done, identify the commit where the GitHub import left off by checking the commit logs. After that, cherry-pick the necessary commits into your Git repository using git cherry-pick. Although this requires manual intervention, it ensures that your Git commit history remains intact and does not include any extraneous metadata, allowing for a controlled merge.