Syncing a Git repository with an SVN repository
I git svn clone ‘d the SVN repository a month ago and started building the source code with newer version of compiler. Within a month, the original SVN repo has changed (number of people made a bunch of commits). Now I want to have all those changes in the git repository.
I tried adding svn-remote section to the config file of git. according to this
- What could be causing feature1 branch's commits to show up in feature2 branch logs?
- Git Staged - It have file history?
- Can you “ignore” a file in Perforce?
- Visual Studio&Source Control: How to have shared code?
- How important is a bug tracking tool for a lone developer, and which one along with a VCS should I look at?
- CakePHP - gitignore
But it did not work. Any ideas or suggestions ? I would like to have a history of all commits that were made to the svn repo. (authors and commit messages in the git log)
One Solution collect form web for “Syncing a Git repository with an SVN repository”
When you create a Git working directory using
git svn clone, under the covers it runs a bunch of different commands:
git init to set up the initial Git repository,
git svn init to set up the Subversion metadata, then
git svn fetch to pick up all the commits from the Subversion repository.
git svn fetch again will pick up all the changes since your last
git svn fetch (or that initial
clone) and add them to your Git history.
That said, if you’ve since messed around with the Git configuration, you may find you have new problems, since you could have messed up the original configuration. Your best bet if that’s the case is to remove the initial Subversion metadata with
git config --remove-section svn-remote.svn and then run
git svn init with the same arguments you gave to
git svn clone the first time around.