Last active
August 29, 2015 14:07
-
-
Save lajlev/3c0ef3b6bb76bc54abfa to your computer and use it in GitHub Desktop.
Lazy git commit function
This file contains hidden or 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
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