Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6340235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:47:48+00:00 2026-05-24T19:47:48+00:00

This question might be down to the fact I don’t understand how branching works

  • 0

This question might be down to the fact I don’t understand how branching works technically in SVN and Git.

But when I use svn2git some of the branches are in refs/remotes/ and some are not. For instance trunk is /refs/remotes/trunk.

And when I check the master branch in the new git repo, it is not the svn trunk but some old branch from last year (and it looks like it’s selected completely random). Tags are moved correctly.

If I look at the svn repo in Trac, it does look like the layout is correct (trunk, branches, tags) and the trunk points to where it should. It also looks like the branches that are shown correctly (no remotes) are in .git/config, the rest aren’t.

What’s going on here and what should I do to convert the svn repo correctly? Should I just add defintions for the remote branches to .git/config as well? This wouldn’t solve the trunk problem, however.

EDIT: I just realised something: thre remotes are exactly the same as the local branches with the difference that there is a local branch “master” and remote branch “remotes/trunk”, all other 19 branches seem similar. Problem seems to be that master is not pointing to “remotes/trunk” but rather to some random commit.

Is this just a bug in svn2git?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:47:49+00:00Added an answer on May 24, 2026 at 7:47 pm

    It must be a bug. According to the readme in github for git2svn

    and that the code checked into master ends up being what’s currently
    in your svn trunk rather than whichever svn branch your last commit
    was in.

    You could try manually specifying the branches manually to see if that will get more consistent results

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

    If that doesn’t work you could add an alliase to your .gitconfig file which you could run after the svn2git which would replace master with trunk

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

    then you do your svn2git … as normal and when it is done run git fixport and it will checkout a local copy of remotes/trunk as trunk and reset master to equal that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question might belong on one of the other trilogies, but it sorta seemed
This question might be closed as it sounds vague but I'm really asking this
I know this question might have already been discussed a thousands of times but
I mostly develop using C#, but I think this question might be suitable for
this might question might sounds stupid, but I could'nt figure it out. How can
We've had this question already, but I want to narrow it down to already
This question might not seem programming related at first, but let me explain. I'm
This question might be naive as I'm new to ColdFusion programming. I have a
I believe this question might have been previously attempted in 2006 on a different
I'm not a regular C++er, so this question might be fairly trivial: Can anybody

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.