Last active
August 22, 2019 17:10
-
-
Save joduplessis/95bb1772fbcd62dac60cb6b767892687 to your computer and use it in GitHub Desktop.
A super convenient script to automate committing to repos. Simply say: gitty "Commit my stuff" to commit your changes to the current branch.
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 | |
branch=$(git branch | grep \* | cut -d ' ' -f2) | |
echo "Commit to '$branch', with message '$1'" | |
read -p "Wnat to continue? (y): " choice | |
if [ $choice == "y" ]; then | |
env -i | |
git add -A | |
git commit -m "$1" | |
git push origin $branch | |
echo "Done" | |
else | |
echo "Bye" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also make sure it's on your path & executable with
chmod +x ./gitty
.