使用git status快速commit

提交之前使用git status可以看到将要提交的文件,如果想部分提交,需要单独commit。使用下面这句可以快速commit

git commit `git status | grep 'mod' | awk '{print $3}' | grep -v 'index'`


git commit 后面跟的不是单引号,键盘位置在esc下面或者数字1左边

awk '{print $3}' 是选中第三列

grep -v 是排除某个包括该字符串的文件,此处是排除index.php



原文地址:https://www.cnblogs.com/JasonLeemz/p/5068170.html