gitPush.sh 223 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #!/bin/bash USER=$(whoami) if [[ "$USER" != "root" ]];then echo "ERROR:需切换到root用户!" exit 1 fi if [[ $1 ]];then cd $1 git add . git commit -m "auto push by shell" git push else echo "未输入路径" fi