Skip to content

Instantly share code, notes, and snippets.

@ekilah
Created August 27, 2015 23:09
Show Gist options
  • Save ekilah/88a880c84a50b73bd306 to your computer and use it in GitHub Desktop.
Save ekilah/88a880c84a50b73bd306 to your computer and use it in GitHub Desktop.
Git alias to push current branch to upstream branch of the same name
[alias]
pushup = "!gitbranchname() { git symbolic-ref --short HEAD; }; gitpushupstream() { git push --set-upstream origin `gitbranchname`; }; gitpushupstream"
@ekilah
Copy link
Author

ekilah commented May 29, 2016

late reply, but no problem! glad it helped

@zenlor
Copy link

zenlor commented Aug 25, 2016

just a note to self (this is easier to even remember)

[alias]
    pushup = "!git push --set-upstream origin $(git symbolic-ref --short HEAD)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment