Skip to content

Instantly share code, notes, and snippets.

@jottenlips
Last active November 26, 2019 17:03
Show Gist options
  • Save jottenlips/c39c10a3c73b2e02729dd30e0f466686 to your computer and use it in GitHub Desktop.
Save jottenlips/c39c10a3c73b2e02729dd30e0f466686 to your computer and use it in GitHub Desktop.
πŸ– lazy git push upstream

Tired of doing copy pasta for your new branch?

add these lines to .bashrc .zshrc or .bash_profile

alias branch='git symbolic-ref --short HEAD'

alias upstream='git push --set-upstream origin $(echo $(branch))'

branch prints current branch

upstream runs git push --set-upstream origin CURRENT_BRANCHNAME

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