Find the REMOTE parent branch of a LOCAL git branch
问题 How do I get the name of the remote git branch from which the local git current commit was branched-off? I assume this is a 4 step process, and that the first three steps might be as follows: Step One: Get the name of the current branch in the local git repo: git rev-parse --abbrev-ref HEAD Step Two: Get the hash of the currently checked out commit from the local repo: git rev-parse HEAD # full hash Step Three: Get the name of the upstream tracking branch on the remote git repo: git rev-parse