Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Created December 11, 2009 04:50
Show Gist options
  • Save ryanbriones/253993 to your computer and use it in GitHub Desktop.
Save ryanbriones/253993 to your computer and use it in GitHub Desktop.
if [ "$1" ]; then
BRANCH=$1
else
BRANCH=$(git branch | grep '*' | cut -d ' ' -f2)
fi
REMOTE=$(git config --get branch.$BRANCH.remote)
REMOTE_BRANCH=$(git config --get branch.$BRANCH.merge)
echo "$REMOTE/${REMOTE_BRANCH##*/}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment