Skip to content

Instantly share code, notes, and snippets.

@kuckmc01
Last active August 7, 2017 16:04
Show Gist options
  • Save kuckmc01/9d3ca47cb0f3c871c93027673d1656a2 to your computer and use it in GitHub Desktop.
Save kuckmc01/9d3ca47cb0f3c871c93027673d1656a2 to your computer and use it in GitHub Desktop.
Push git current branch without typing branch name.
#!/usr/bin/env bash
# Add to .bash_profile: alias pushit='. /locationtofile/pushit.sh'
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo "pushing to branch $CURRENT_BRANCH"
git push origin $CURRENT_BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment