gitlab-runner环境免密码配置

解决linux 系统 git pull,push每次都需要输入密码问题

1
git config --global credential.helper store

然后下次再执行 git pull 或者git push 时会提示输入用户名密码,按提示输入用户名密码即可。之后git就会记录本次用户信息,再次执行 git pull 或者 git push 时候就不用输入用户名密码信息了。

配置用户名密码

1
2
3
git config user.name "username"
git config user.password "password"
git config user.email "username@163.com"

gitlab-runner test

1
2
3
4
5
6
7
8
9
. /etc/profile.d/gitlab-runner.sh
cd
git clone http://username:password@gitlab.younet.cn/Blog/src-hexo-7.0.git
cd ~/src-hexo-7.0
git config --global credential.helper store
cd ~/src-hexo-7.0/src/
nvm use 18.18.2
npm install
hexo clean ;hexo g ;hexo d