Branches transferred using svn2git

This question may be related to the fact that I do not understand how branching works technically in SVN and Git.

But when I use svn2git, some branches are in refs / remotes / and some are not. For example, trunk is / refs / remotes / trunk.

And when I check the main branch in the new git repo, this is not the svn trunk, but some kind of old branch from last year (and it looks like it was chosen completely random). Tags moved correctly.

If I look at svn reverse in Trac, it looks like the layout is correct (trunk, branches, tags) and the points of the connecting lines where they should be. It also looks like branches that are shown correctly (without remotes) are in .git / config, the rest are not.

What happens here and what to do to correctly convert svn repo? Should I just add fixes for remote branches in .git / config? However, this would not solve the problem with the trunk.

EDIT: I just realized something: thres consoles are exactly the same as local branches, with the difference that there is a local branch "master" and a remote branch "consoles / trunk", all the other 19 branches seem similar. The problem seems to be that the master does not indicate a โ€œdistance / torso,โ€ but rather an accidental commit.

Is this just a bug in svn2git?

+7
git svn
source share
1 answer

This is mistake. According to readme on github for git2svn

and that the code verified by the master ends up being in your svn torso and not any svn branch of your last commit was currently in.

You can try manually specifying branches manually to see if they get more consistent results.

svn2git http://svn.example.com/path/to/repo --trunk trunk --tags tags --branches branches 

If this does not work, you can add alliase to your .gitconfig file, which you could run after svn2git, which would replace the host with trunk

 [alias] fixport = !sh -c 'git checkout remotes/trunk trunk && git checkout master && git reset --hard trunk' 

then you do your svn2git ... as usual, and when that is done, run git fixport and it will check the local copy of the remotes / trunks as the trunk and reset master to do this.

0
source share

All Articles