永久存储用户/密码GIT

时间:2015-08-27 05:59:23

标签: git svn github jenkins keystore

我正在从事Jenkins / Git / Repo工作。我想问一下詹金斯的git配置。
这是我的情况:
我在配置Git / SVN / Repo的MAC主机上使用了jenkins。 在詹金斯,我为每个工作都有多个账户 例如
  - 对于工作A我使用帐户git A来克隆代码
  - 对于工作B我使用账户SVN B来结账代码

我还将用户添加到 .gitconfig 文件

  

[凭证]
      helper = store

     

[用户]
      name = user
      email = user@company.net

.git-credential 文件中,我的帐户信息已自动添加。这是内容:

  

https://user:pass@jenkins.host.xxx

我的问题是:
如果我建立工作A - >作业B的信息帐户将在 .git-credential 中清晰显示。相反,如果我建立工作A,工作A的信息帐户将是明确的。 因此我必须通过手动再次添加它。这是一种愚蠢的方式 如果你知道,请支持我 非常感谢你!

1 个答案:

答案 0 :(得分:1)

您应该使用jenkins的Credentials功能来存储您的用户名/密码。

  • 在侧边菜单上,点击凭据
  

enter image description here

  • 点击全局凭据
  

enter image description here

  • 点击添加凭据
  

enter image description here

  • 填写您的用户名和密码,然后单击确定按钮
  

enter image description here

现在,在您的jenkins工作中,您可以在存储库网址下选择此凭据

  

enter image description here

相关问题