Git
克隆
git clone https://gitee.com/liu-qiyao/baichen.git
下载远程代码并合并
git pull
上传代码到远程并合并
git push
git config --global credential.helper store
使用此命令后还会需要输入一次用户名和密码,但是下一次就不需要了
#!/bin/bash
CONUSER='username'
CONPASS='password'
cd /data/web/
git reset --hard
expect -c "spawn git clone https://gitee.com/liu-qiyao/baichen.git; expect "*Username*" { send "${CONUSER} "; exp_continue } "*Password*" { send "${CONPASS} " }; interact"
然后设置定时执行即可。