Authored by chunhua.zhang

auto push by shell

USER=$(whoami)
if [[ "$USER" != "test" ]];then
echo "ERROR:需切换到test用户!"
exit 1
fi
if [[ $1 ]];then
cd $1
git reset --hard origin/master
git pull;
else
echo "未输入路径"
fi
... ...
#!/bin/bash
USER=$(whoami)
if [[ "$USER" != "test" ]];then
echo "ERROR:需切换到test用户!"
exit 1
fi
if [[ $1 ]];then
cd $1
git add .
git commit -m "auto push by shell"
git push
else
echo "未输入路径"
fi
... ...