How to get the name of the remote branch git
from which the local commit git
was forked?
I assume this is a 4-step process, and that the first three steps may 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 commit from the local repo:
git rev-parse HEAD
Step 3. Get the name of the upstream tracking branch on the remote git repository:
git rev-parse --abbrev-ref @{upstream}
Step Four: Get the name of the parent upstream tracking branch on the remote git repository:
? @ChrisJohnsen, , , , . , , , . , , .
bash
, CentOS-, bash
.