Answer the question
In order to leave comments, you need to log in
How to transfer the SVN repository, with problems in the structure, from sourceforge.net to GIT (github)?
Hello!
In general, there is such a problem. There is a SVN turnip of the project on sourceforge with a lovingly laid out rake and there is a desire to transfer it to github as quietly as possible, according to commits, and as correctly as possible. The current structure is not complicated - a trunk, one branch, one tag, all following standard paths. The problem is that before revision 774 there was none of this, not even a trunk! That is, in fact, the trunk of the project lay directly in the root of the repository, then they came to their senses, but the rake remained. So, I want to: Move the project to GitHub with all commits, tags and branches saved, as if there was never an unfortunate misunderstanding in the form of project files lying at the root.
Answer the question
In order to leave comments, you need to log in
That's it, problem solved! Thanks to comrade pavel_mayorov from StackOverflow. In short, if someone has a similar problem, then we do this:
git svn clone -r1:1 --ignore-paths="^[^/]+/(?:branches|tags)" --preserve-empty-dirs --placeholder-filename=dummy.txt -A svn-git_users.txt url://to.root.of.svn.repo/ local/path/to/git-repo
With this we initialize the repository and merge the very first commit. Next, merge the turnip but only by the commit that last lived in the root of the repository: cd local/path/to/git-repo && git svn fetch -r2:773
After that, " on the advice of friends " (C) edit ./.git/config and fetch the remaining commits again: git svn fetch
, reset HEAD to the really last commit: git reset --hard e4a54bd9
(Hash last merged commit) everything, telemarket. Pumping out branches and tags, bringing the turnip into a digestible state and pulling it to the github, remains a purely technical task, which is written about in the well-known book and articles on Habré. The results can be viewed here .
There is a standard tool git svn
It will go through the history and do everything right.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question