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
おすすめ