Search code examples
gitgit-svngit-bare

Track a branch in a bare git-svn


When I run this command:

git --git-dir=firebird.git branch -a

This is my output:

  B1_5_Release
  B2_0_Release
  B2_1_Release
  B2_5_Release
* master
  remotes/B1_5_Release
  remotes/B2_0_Release
  remotes/B2_1_Release
  remotes/B2_5_Release
  remotes/B3_0_Release
  remotes/origin/B1_5_Release
  remotes/origin/B2_0_Release
  remotes/origin/B2_1_Release
  remotes/origin/B2_5_Release
  remotes/trunk

A B3_0_Release branch was created in Subversion after this git-svn tree was setup. I don't have a B3_0_Release tracking remotes/B3_0_Release, or something like this. This is a bare repository, so I can't do a "git checkout -b ...".

How can I add this new branch to this bare repository?


Solution

  • The simplest way to create a branch in a git repository is git branch <branch_name> [<where to branch at>], which would work for bare repositories as well, in your case

    git --git-dir=firebird.git branch B3_0_Release remotes/B3_0_Release
    

    Beware it won't be updated automatically upon changes at the svn upstream (neither the other local branches probably).