Skip to content

Instantly share code, notes, and snippets.

@andycochrane
Created February 22, 2018 14:40
Show Gist options
  • Save andycochrane/4240058039fa386b4129a498eedcaeb9 to your computer and use it in GitHub Desktop.
Save andycochrane/4240058039fa386b4129a498eedcaeb9 to your computer and use it in GitHub Desktop.
Alias for setting the upstream of a branch
[alias]
upstream = "!f() { \
REMOTE=${1-origin}; \
OUTPUT=$(echo $(git push -u $REMOTE $(git rev-parse --abbrev-ref HEAD))); \
echo $OUTPUT; \
}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment