【问题标题】:Jenkins Git plugin - 401詹金斯 Git 插件 - 401
【发布时间】:2013-01-06 04:31:02
【问题描述】:

我尝试了各种不同的方法,但我无法让 jenkins 很好地使用 git。

我已经设置了我的 ssh 密钥并验证了我可以 ssh 到 git hub 并且我收到了消息。 我也尝试过不带 .git 扩展名。我已经尝试在 url 中使用用户名,在 url 中使用用户名和密码,并且根本没有用户名/密码。没关系。

我也尝试过使用管理员用户和普通推/拉用户。

我尝试访问的 git 存储库是通过“组织”进行的,但我所在的团队有权访问。

Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone https://github.com/xxx/xx
hudson.plugins.git.GitException: Could not clone https://github.com/xxx/xx
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1073)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1014)
    at hudson.FilePath.act(FilePath.java:788)
    at hudson.FilePath.act(FilePath.java:770)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1014)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:579)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:468)
    at hudson.model.Run.run(Run.java:1408)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:478)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Error performing command: git clone --progress -o origin https://github.com/xxxx/xx /var/lib/jenkins/jobs/test/workspace
Command "git clone --progress -o origin https://github.com/xxxx/xx /var/lib/jenkins/jobs/test/workspace" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/jobs/test/workspace/.git/
error: The requested URL returned error: 401 while accessing https://github.com/xxxx/xx/info/refs

【问题讨论】:

  • 是的,它是一个私人仓库

标签: git github jenkins


【解决方案1】:

尝试使用 r/w 地址通过 ssh 密钥克隆私有存储库:

git@github.com:xxx/xx.git

【讨论】:

  • 效果很好。我还不到 15 岁,所以我无法回答。
  • 现在你是;) 你也可以将答案标记为正确吗?谢谢。
【解决方案2】:

如果您在 URL 上传递凭据,请确保它们是 URL 编码的。还要确保您使用的是基本身份验证。

【讨论】:

  • 是的.. 我没有任何需要编码的字符。奇怪的是,我什至无法从命令行运行该命令。我可以从我的开发箱上的命令行推/拉。我可以很好地推拉,但是如果我运行该克隆命令,它就会爆炸。
猜你喜欢
  • 1970-01-01
  • 2013-11-05
  • 2015-05-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-22
相关资源
最近更新 更多