Skip to content

Instantly share code, notes, and snippets.

@lajlev
Last active August 29, 2015 14:07
Show Gist options
  • Save lajlev/3c0ef3b6bb76bc54abfa to your computer and use it in GitHub Desktop.
Save lajlev/3c0ef3b6bb76bc54abfa to your computer and use it in GitHub Desktop.
Lazy git commit function
function m(){
git add . -A
if [ -z "$1" ]
then
N=0
COMMITS=('Feature' 'Hotfix' 'Visual improvement' 'Various changes')
for i in "${COMMITS[@]}"
do
N=`expr $N + 1`
echo "[${N}] ${i}"
done
read selection
selection=`expr $selection - 1`
MESSAGE=${COMMITS[selection]}
echo "${MESSAGE}"
git commit -m "${MESSAGE}"
else
echo 'other'
git commit -m $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment