Skip to content

Instantly share code, notes, and snippets.

@catchamonkey
Created February 15, 2012 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catchamonkey/1834446 to your computer and use it in GitHub Desktop.
Save catchamonkey/1834446 to your computer and use it in GitHub Desktop.
git push to current branch
git push origin `git rev-parse --abbrev-ref HEAD`
@catchamonkey
Copy link
Author

Pushes (to origin remote) the place your HEAD points to, i.e. the current branch you are on.
I use descriptive names for branches, this lets me always run the same command when I want to push one of them up.

I have it as a bash alias to git_push_current_branch

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