Get remote git-svn branch for current local branch
I’m looking for a snippet that will give me the “pseudo-remote” upstream branch used by git-svn for the currently checked out branch.
Let’s say my local repository was cloned from svn with
git svn clone -s --prefix=my-svn/ ... and I’m on some local branch
topic/foo based on svn branch
How can I figure out which branch under
refs/remotes/ would be updated by a
git svn fetch --parent? (Preferrably without hard-coding any layout information configured in the initial clone.)
One Solution collect form web for “Get remote git-svn branch for current local branch”
git log --grep git-svn-id: --first-parent -1
Then query the
[svn-remote] section in your
.git/config file (use git config) and see which branch the
svn-url obtained from the command above corresponds to.