Skip to content

Instantly share code, notes, and snippets.

@likema
Created March 15, 2017 10:47
Show Gist options
  • Save likema/45cd17b964bbc2e92e80ef7de92dc60f to your computer and use it in GitHub Desktop.
Save likema/45cd17b964bbc2e92e80ef7de92dc60f to your computer and use it in GitHub Desktop.
Push current git branch to origin
#!/bin/sh
current_branch=`git rev-parse --abbrev-ref HEAD`
if [ -z "current_branch" ]; then
echo "You are not in a git repository." >&2
exit 1
fi
git push ${1:--u} origin $current_branch
@likema
Copy link
Author

likema commented Mar 15, 2017

Push the current branch to origin.

gpcb

Push the current branch to origin forcely.

gpcb -f

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