Gitlab https를 당겨 코드 캐시 구성 사용자 암호 작은 노트

유래

业务服务器安全加固不再允许使用个人私有key配置再服务器,为了配置调试方便使用https方式拉取代码,但是发现每次Git pull 、push 都要输入用户和密码,很不方便,特整理此配置。

영원히 암호 기억

会在用户家目录的.gitconfig文件中生成下面的配置。如果没有--global,则在当前项目下的.git/config文件中添加。
git config --global credential.helper store

임시 비밀번호를 기억

默认记住15分钟:

git config –global credential.helper cache

下面是自定义配置记住1小时:
git config credential.helper ‘cache –timeout=3600’

첫 번째 풀을 수행

cd /workspace/kdeploy

git pull 

정보를 입력하는 지시에 따라 :

[root@kdeploy]# git pull 

#输入git用户
Username for 'https://gitlab.com': [email protected] 

#输入git密码
Password for 'https://kevin@[email protected]': 

성공적인 첫 풀 한 기간의 캐시 설정의 코드는 암호를 입력하라는 메시지가 표시되지 않습니다!

추천

출처blog.51cto.com/michaelkang/2460162