Last active
November 16, 2016 01:10
-
-
Save nikhilweee/75ea15afabdfbb18cda625364a9bf9f9 to your computer and use it in GitHub Desktop.
random-commit-messages
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 | |
# You can run this script directly from the terminal | |
# curl -s https://gist.githubusercontent.com/nikhilweee/75ea15afabdfbb18cda625364a9bf9f9/raw/ > /tmp/wtc.sh ; source /tmp/wtc.sh | |
# Just use `gitcommit` instead of `git commit -m` to get random commit messages from whatthecommit.com | |
# start | |
# checking for conflicts | |
unalias gitcommit | |
unalias commitmessage | |
# creating aliases | |
cat <<'END' >> ~/.bash_aliases | |
alias commitmessage="curl -s whatthecommit.com | sed -n -e '/<p>/,/<\/p>/p' | sed -e 's/<[^>]*>//' | tr -d '\n'" | |
alias gitcommit="git commit -m 'WTC: $(commitmessage)'" | |
END | |
# sourcing script | |
source ~/.bashrc | |
# done | |
echo "You can now use 'gitcommit' instead of 'git commit -m <message>' for random commit messages" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment