2012-12-07 21 views

回答

1

您可以使用别名。制作脚本:例如~/supercommit.sh

#!/bin/bash -e 
if [ -z $1 ]; then 
    echo "You need to provide a commit message" 
    exit 
fi 

git submodule foreach git add -A . 
git submodule foreach git commit -am "$1" 

git add -A . 
git commit -am "$1" 

并将其标记为可执行文件(chmod +x)。现在,创建一个别名:

git config alias.supercommit '!~/supercommit.sh "[email protected]"; #' 

这应该做(我将在一个位测试)

+0

似乎工作 - 增加了一些错误检查git的提交信息和这样的。 – Qix

+0

@Qix甜,小心分享? – sehe

+0

是的,我现在编辑它 – Qix

相关问题