Created
July 19, 2018 00:10
-
-
Save bsidhom/8433b01ce1f92f12cccb2af2af70eea8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Show the upstream tracking branch for HEAD | |
git rev-parse --abbrev-ref --symbolic-full-name '@{u}' | |
# Show the upstream tracking branch for `my-branch` | |
git rev-parse --abbrev-ref --symbolic-full-name 'my-branch@{u}' | |
# List each local branch along with its upstream tracking branch | |
git for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment