Search code examples
gitsvnbranchgit-svn

Can't checkout new local branch after successfull git svn fetch


I am using git locally with an SVN repository, with the script "git-svn" that makes the translation. I have no choices about this since my colleagues are still using svn and don't plan on switching to git.

Today I wanted to report a commit on a new remote branche, so I used the command git svn fetch and got something like

Found possible branch point: http://subversion.mycompany.fr/svn/svnroot/myprog/tags/10.225 => http://subversion.mycompany.fr/svn/svnroot/myprog/branches/BR_10.225_PROD, 58136
Found branch parent: (refs/remotes/branches/BR_10.225_PROD) 184efd022c6930cb1890a5701b43ddcb1a2972df
Following parent with do_switch
Successfully followed parent
r58137 = 36565c46d9e522268ebceeca30528bee088c3091 (refs/remotes/branches/BR_10.225_PROD)

Now I wanted to switch to this new branch so I used the command git co BR_10.225_PROD. But I got the error

error: pathspec 'BR_10.225_PROD' did not match any file(s) known to git.

I don't understand because this is not the first time I do this kind of operation, and it used to work easily.

Any hint?


Solution

  • Fixed the old way, according to this answer:

    git checkout -b BR_10.225_PROD remotes/branches/BR_10.225_PROD
    

    did the trick.