How do I tell git-svn about a remote branch created after I fetched the repo?

Hank Gay picture Hank Gay · Nov 17, 2008 · Viewed 72.1k times · Source

I'm using git-svn to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo.

How do I tell Git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the Subversion repo to initialize my Git repo?

Answer

vjangus picture vjangus · Sep 16, 2009

You can manually add the remote branch,

git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/
git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch
git svn fetch newbranch [-r<rev>]
git checkout -b local-newbranch -t newbranch
git svn rebase newbranch