Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Created May 10, 2018 15:36
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 a2ikm/c8b5ec20710f37ae8955e6fe3d884566 to your computer and use it in GitHub Desktop.
Save a2ikm/c8b5ec20710f37ae8955e6fe3d884566 to your computer and use it in GitHub Desktop.
#!/bin/sh
remote="origin"
if git remote | grep fork >/dev/null 2>&1; then
remote="fork"
fi
branch="$(git rev-parse --abbrev-ref HEAD)"
git push -u $remote $branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment