While working on a usual git repository a local branch usually tracks a corresponding remote upstream branch. This way I can easily see, whether I am ahead or behind of my upstream branch and therefore if I need to push or pull to bring them in sync. Also my prompt immediately shows this state, which is very convenient.
Now I am working on a SVN repository using git-svn
. I used --prefix=svn
for the clone, therefore git branch -r
lists svn/trunk
as a remote branch, but (although git svn rebase
works without problems) it is not configured as an upstream branch for my master branch.
I tried to set the tracking information manually but it failed:
$ git branch -r
svn/trunk
$ git branch --set-upstream-to=svn/trunk
fatal: Cannot setup tracking information; starting point 'svn/trunk' is not a branch.
Is there some way to track an svn upstream branch?
Is there some other easy way to know whether I am ahead or behind to that branch? (Looking at gitk --all
is currently the only way I am aware of.)
Is there even some way to make my (bash __git_ps1
) prompt show that information?
$ git --version
git version 1.9.0.msysgit.0