I would like to know if there's a way to tell which local branch is tracking which remote branch in Git.
I'm using one remote server, which is named "origin".
|
I would like to know if there's a way to tell which local branch is tracking which remote branch in Git. I'm using one remote server, which is named "origin". |
|||
|
|
|
Using the example of my copy of Puppet checked out from the upstream Git repository on Github.com...
Then if I were to execute the following:
And finally re-run the
|
|||||||||
|
shows you all branches as well as the name of the upstream branch. |
|||||||||||||||||
|
|
Jeremy Bouse illustrates how If you plan on using the information in an automated context (e.g. a script) you should use the lower-level (“plumbing”)
The |
|||||
|
|
For a particular branch, you can use
... or for the abbreviated form, add
You can generally use the |
|||
|
|
I use the following shell script (named
This could also use the mentioned |
|||||
|
|
|
||||
|
|
|
Add these runes to the
|
||||
|
|
|
Try
Otherwise, examine your |
|||||
|
shows exactly what you ask for. It shows the local branches together with the corresponding remote branch they are tracking. |
|||
|
|