I'd like to add a copy of a remote branch (origin/featureX
) to my local repository.
Therefore I generated a local branch featureX
and set it to track the given remote branch:
git branch featureX
git branch -u origin/featureX featureX
# Branch featureX set up to track remote branch featureX from origin.
Now is there a way to show this connection? I tried e.g. git branch -av
, but no connection between featureX
and remotes/origin/featureX
are shown.
You need to be more verbose git branch -vv
, this is documented but not obvious.
-v
-vv
--verbose
When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any). If given twice, print the name of the upstream branch, as well (see also git remote show ).
To see the linkage easily, double the -v
option:
$ git branch -v
* master b9a3e01 [ahead 3]
$ git branch -vv
* master b9a3e01 [origin/master: ahead 3]
See VonC's answer for a more convenient way to get these things started, in most cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With