Skip to content

Instantly share code, notes, and snippets.

@ekilah ekilah/.gitconfig
Created Aug 27, 2015

Embed
What would you like to do?
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"
@dmr-loggly

This comment has been minimized.

Copy link

commented Dec 30, 2015

Thanks for posting this on the web, I was trying to figure out how to make exactly this alias. 👍

@ekilah

This comment has been minimized.

Copy link
Owner Author

commented May 29, 2016

late reply, but no problem! glad it helped

@zenlor

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.