Due
业务服务器安全加固不再允许使用个人私有key配置再服务器,为了配置调试方便使用https方式拉取代码,但是发现每次Git pull 、push 都要输入用户和密码,很不方便,特整理此配置。
Remember password forever
会在用户家目录的.gitconfig文件中生成下面的配置。如果没有--global,则在当前项目下的.git/config文件中添加。
git config --global credential.helper store
Remember temporary password
默认记住15分钟:
git config –global credential.helper cache
下面是自定义配置记住1小时:
git config credential.helper ‘cache –timeout=3600’
Performing a first pull
cd /workspace/kdeploy
git pull
Follow the prompts to enter information:
[root@kdeploy]# git pull
#输入git用户
Username for 'https://gitlab.com': [email protected]
#输入git密码
Password for 'https://kevin@[email protected]':
After a successful first pull the code, in the cache setting of the time period will not be asked to enter your password!