09 May 2012

Git Svn : Refspec glob conflict

At work we use Subversion as our current source control tool. Which is OK but I prefer using Git. So to get my fix while I wait for a conversion to Git at work I use git svn as my subversion client. Usually this is painless but sometimes, like today, problems show up.

I did a regular git svn rebase and got this problem in return:

$ git svn rebase
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: path/to/app/branches/trunk
    real path: path/to/app/trunk
Continuing ahead with path/to/app/trunk
Current branch master is up to date.

I'm not the first to have this problem so I found an explanation (and solution) at CodeUtopia. The problem was that git had spontaneously duplicated lines in .git/config that points to the remote trunk, tags and branches in subversion. I removed the duplicates and everything was fine again.

11 comments:

  1. Excellent, thanks! I think the duplication happens when the git svn clone ... is run several times over the same tree.

    ReplyDelete
    Replies
    1. Yep, that's exactly it. I had a missing user name in my authors file so in a mistake I cloned twice. I should have just done a git svn fetch.

      Delete
  2. Can't thank you enough for that :).
    Sounds weird that git does that by himself though.

    ReplyDelete
    Replies
    1. You're welcome!
      It is strange that there is no check on this in Git. But on the other hand it feels very much in Git's nature. It is easy to make mistakes if you're not careful but it is also easy to fix it afterwards. :)

      Delete
    2. So I come to this page, that helps me a great deal to realize that I posted a thank you message for this very post almost exactly a year ago.

      I feel a bit stupid right now.
      Well, thanks again I guess :D.

      Delete
    3. You're welcome again! :)
      I know what you mean. It's hard to remember those small details. At least you know where to look now. ;)

      By the way, I love your travel blog. I was in Vietnam in 2003 and your wonderful pictures brought back all the memories.

      Delete
    4. What travel blog?

      May I have the URL?

      Cheers!

      Delete
    5. Oh, ok now I get it! This is a domain I reserved for a friend.

      The blog is not mine but the one from a very good friend of mine :). They travelled around the world for two years.
      And he is in Thailand again since yesterday, for work this time! :)

      Delete
    6. It was "Un Grand Tour". I just assumed it was yours since it was linked from your blogger profile.
      Good for your friend to be in Thailand at this time of the year and get away from the european winter for a while. :)

      Delete
  3. Awesome! Never would have found this without your help!

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete