How to determine LOCAL tracked branch?

Ok the situation is as follows:
I have a git branch in my local repository called ‘feature-branch’.
This branch is git-svn enabled, it is tracking the local branch ‘remotes/svn/branches/feature-branch’ .
And this branch is tracking a SVN branch in an external repository.

Now I know how to determine which SVN branch is tracked, this can be done with git svn info .
However, how can I determine which LOCAL remote branch is tracked by my feature branch?
Ie. how can I determine ‘feature-branch’ is tracking ‘remotes/svn/branches/feature-branch’ ?

With ‘normal’ tracking branches in GIT, I can do git branch -avv and it will show for each branch with branch it is tracking. (Which is also pretty cumbersome…)

My end goal is to be able to show the commits which have not yet been pushed to the SVN repository. I can do this easily by running git log $remote..HEAD .
But then I need to know what $remote is …

  • SVN - ignoring files already in repository
  • Why would I not want a central repository in versioning? SVN vs. Git question
  • How to git version control multiple projects with one framework project?
  • Unexpected merge error in a git svn system?
  • Avoiding ASP.NET passwords in github?
  • SVN - How to work with directories containing @ sign?
  • Subversion and shared files across repositories/projects?
  • SVN+SSH Connection Giving Error 210002, Network Connection Closed Unexpectedly
  • One Solution collect form web for “How to determine LOCAL tracked branch?”

    Your feature-branch is tracking a git commit (defined by an SHA1 hash). It is not tracking an SVN branch as git-svn does not create a remote for the SVN server (all fetch/rebase/tag/branch/commit functions to/from the SVN server are done using git svn ...).

    Per the git-svn documentation:

    note the following rule: git svn dcommit

    will attempt to commit on top of the SVN commit named in

    git log --grep=^git-svn-id: --first-parent -1

    …so you were correct in using git svn info or git log --grep=^git-svn-id: --first-parent -1 to determine the SVN tracked branch.

    To find out all of the other known Git branches which contain a certain commit (based on SHA1 hash) try git branch --all --contains <commit-hash> (ex: git branch --all --contains 856ce — partial hashes should work fine).

    To get the full commit hash of your current branch try git rev-parse HEAD. However, you will likely want the full commit hash of the last SVN commit instead, so you will want to use the SHA1 hash of the output from git log --grep=^git-svn-id: --first-parent -1.

    To get the log from the last commit to HEAD, you need to find your SVN tracking branch (as you have already figured out how to do) and plug it into the following:

    git rev-list --date-order --max-count=1 <svn-tracked-branch>
    git log <above-returned-hash>..HEAD

    ex (with git, partial hashes almost always work):

    $ git rev-list --date-order --max-count=1 trunk
    $ git log 117bbf..HEAD
    commit f071e1781a98c33c2b36c21aedce4a9ab2311d47
    Author: Me <>
    Date:   Fri Aug 30 15:19:27 2013 -0700

    You will probably get more useful information if you use the SHA1 hash from git log --grep=^git-svn-id: --first-parent -1 rather than taking the extra step of running the git rev-list --date-order --max-count=1 <svn-branch> command.

    Git Baby is a git and github fan, let's start git clone.