Git move from SVN: Where does git 2.6 store svn tracking branches?
I have the task to move a project from SVN to Git and I followed the tutorial in https://git-scm.com/book/it/v2/Git-and-Other-Systems-Migrating-to-Git. The good point: it worked! The sad point, the tutorial seems to be out-dated when it comes to moving the remote refs for tags and branches.
The tutorial states, that they are stored in
- How to have TortoiseSVN always freeze svn:externals for tags
- svn externals not working
- Merge two git repository histories
- How do I build on specific commit in Git on Jenkins?
- (Visual)SVN ignore files by Regex
- Compatibility of Eclipse Luna with SVN 1.6
however, in my svn clone, this directory is empty. They seem to be stored in
Same for branches, I expected them in
but found them in
So, my question to you is now: is it safe to follow the tutorial but replace the corresponding paths with the one, I found?
Assuming that it is indeed safe, I copied the references to their new destination. Unfortunately, that doesn’t work for me:
$ git tag --list $
Even though, the folder
.git/ref/tags/ is not empty. There I find tag-named folders with the following files:
-rw-r--r-- 1 delo 1049089 96 Nov 12 10:00 .rev_map.9585454d-0aa9-4b53-3453-ca0f383a6637 -rw-r--r-- 1 delo 1049089 247K Nov 12 10:00 index -rw-r--r-- 1 delo 1049089 24 Nov 12 10:00 unhandled.log
Same for the branches. I think, this is not what it is supposed to be…
How do I fix that?
One Solution collect form web for “Git move from SVN: Where does git 2.6 store svn tracking branches?”
I think it is pretty safe. Note that you could always create a backup before moving them.
Another approach is to use the steps from this tutorial.
Basically, you can do:
for tag in `git branch -r | grep "tags/" | sed 's/ tags\///'`; do git tag -a -m"Converting SVN tags" $tag refs/remotes/$tag done