Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amazingsmash/560b9b77c7109b35a4569ffaa23da5cb to your computer and use it in GitHub Desktop.
Save amazingsmash/560b9b77c7109b35a4569ffaa23da5cb 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