Git
克隆
git clone https://gitee.com/liu-qiyao/baichen.git
下载远程代码并合并
git pull
上传代码到远程并合并
git push
Linux上git pull等操作需要每次都输入用户名和密码等问题
git config --global credential.helper store
使用此命令后还会需要输入一次用户名和密码,但是下一次就不需要了
shell脚本自动拉取git代码
#!/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"
然后设置定时执行即可。