编写脚本 push.sh 放在提交根目录中 git add . read comment if [ -n "$comment" ]; then comment=$comment else comment="空的提交描述" fi git commit -m "$comment" git push 执行权限 chmod 777 push.sh 提交效果 执行脚本回车两次,默认不指定提交描述时默认描述是空的提交描述 自定义提交内容描述