Skip to content

Instantly share code, notes, and snippets.

@joduplessis
Last active August 22, 2019 17:10
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 joduplessis/95bb1772fbcd62dac60cb6b767892687 to your computer and use it in GitHub Desktop.
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.
#!/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
@joduplessis
Copy link
Author

Also make sure it's on your path & executable with chmod +x ./gitty.

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