No, in the sense that wah
points to the same commit no matter which of the three branches it was created from in this case.
But yes, because git keeps track of which branches are upstream from which others. So when it comes time to synchronise the wah
branch with its 'upstream' branch, git will 'want' to synchronise (send) commits to whichever branch is considered to be the upstream. With the following command:
git push . # '.' means the local repo
... if wah
was branched off master
, the push will want to send commits to (i.e., merge with) master
; if branched off foo
, then foo
; and so on.
Of course, whether or not this is allowed is controlled by another configuration setting: push.default
. If push.default
is set to upstream
, then it will work as I described above. If it's set to simple
or matching
, the push will fail saying you can implicitly push branches only to other branches with the same name.
A simple way you can get git to show you which branches are based on which others, is with the following command:
git branch -avv
This shows you each branch and its upstream branch next to it in brackets.
So the upshot is that yes, internally git does keep track of which specific branch you branched off, and applies that knowledge in a very specific situation as described above.