Created
January 21, 2021 22:59
-
-
Save aweary/57effb79fdeed5308d0e4b303e5743d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ "$BRANCH" = 'master' ] | |
then | |
echo You must check out a feature branch first | |
exit 1 | |
fi | |
if [ -z "$(git status --porcelain)" ] | |
then | |
echo There are no changes to commit | |
exit | |
fi | |
git add . | |
git commit | |
git push --set-upstream origin "$BRANCH" | |
# Replace {user} and {project} here | |
open "https://github.com/{user}/{project}/compare/$BRANCH?expand=1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment