Git alias:
upstream-branch = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)
Example:
git upstream-branch
origin/main
Compare:
-
git current-branch - Get the current branch name
-
git upstream-branch - Get the upstream branch name (this alias)