Skip to content

Instantly share code, notes, and snippets.

@nbkhope
Last active January 15, 2018 05:44
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 nbkhope/cd82ea480d9fc46e8f25e6a3b09d39d8 to your computer and use it in GitHub Desktop.
Save nbkhope/cd82ea480d9fc46e8f25e6a3b09d39d8 to your computer and use it in GitHub Desktop.
Push the current branch to origin with the `gp` command
gp() {
if [ -d ".git" ]
then
BRANCH_NAME="$(git branch | grep '*' | cut -d' ' -f2)"
git push origin "$BRANCH_NAME"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment