git's --help and man page very clearly shows good ways to set upstream for a branch, but I have not found a great way to get the current upstream.
Unfortunately, git branch -v
shows only the relationship to the upstream branch, and doesn't tell you what remote the upstream branch is using.
I have a workaround, git config --get branch.branch_name.remote
but is there another way?
A couple of options.
If you pass in the -v parameter twice then git will print the upstream in addition to the relationship
git branch -vv
You can also use something like
git name-rev @{u}
Where @{u}
is a special git reference for your upstream.
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