push.sh
#!/bin/bash
set -e
WORKDIR="$(cd "$(dirname "$0")" || exit 1;pwd)"
cd "${WORKDIR}"
git pull
TIME=$(date "+%Y%m%d%H%M")
COMMIT_MSG=${TIME}
if [[ $# -eq 2 && "$1" = "-m" ]];then
COMMIT_MSG=$2
fi
git add --all
git commit -m "${COMMIT_MSG}"
git push
把push.sh放到git工程的主目录下面,当有变更时,执行bash push.sh即可
支持bash push.sh -m 提交说明的方式修改提交说明,默认为时间戳
1512





