Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (13 sloc) 471 Bytes
commit=$(git log -1 --pretty=%h)
message=$@
: ${message:="$(curl -s whatthecommit.com/index.txt)"}
git add .
changes=$(git diff $commit)
if [ -z "$changes" ]; then
exit 0
fi
[ -z $(git config user.name) ] && git config --global user.name $(git log -1 --pretty=%an)
[ -z $(git config user.email) ] && git config --global user.email $(git log -1 --pretty=%ae)
git commit -m "$message"
branch=$(git rev-parse --abbrev-ref HEAD)
git push origin $branch --force-with-lease
You can’t perform that action at this time.