Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amazingsmash/e9925cc4497bea8af7326b2a4d4a7f8e to your computer and use it in GitHub Desktop.
Save amazingsmash/e9925cc4497bea8af7326b2a4d4a7f8e to your computer and use it in GitHub Desktop.
Little Git cheat that saves me A LOT of time. Use with caution. Usage: 'git cmp "Commit message"'
git config --global alias.cmp '!f() { git status &&
read -p "Are you sure? " -n 1 -r &&
if [[ $REPLY =~ ^[Yy]$ ]]
then
git add -A && git commit -m "$@" && git push
fi; }; f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment