I've seen this answer (git branch -r vs git remote show origin) which notes that one queries locally whilst the other connects to the server. However, the displayed format for these queries is different.
Is there a difference in what they display or do they simply show the same information but formatted very differently?
You can see exactly what's fetched from the remote server by comparing the output of git remote show origin
with git remote show -n origin
. The latter command will not connect to the remote server. As a result, it does not query which branch the server's HEAD is on, and uses locally cached information in a few places.
git branch -r
shows information on which branches your local tracking branches push to. git remote show origin
shows that, plus more information: which branch is checked out on the server, the URLs your remote uses, and how your git configuration is set up to treat a push.
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