【问题标题】:Git push to GitHub failing - seems to be trying to use HTTP?Git 推送到 GitHub 失败 - 似乎正在尝试使用 HTTP?
【发布时间】:2009-08-21 02:44:29
【问题描述】:

我在 Ubuntu 8.04 切片上设置了一个 Hudson 连续集成服务器,git 版本为 1.6.4。我可以让它从私人仓库 GitHub 中提取代码,但我似乎无法让它在构建后将标签推回。我看到以下内容:

# sudo -u hudson git push --tags
XML error: syntax error
error: Error: no DAV locking support on https://github.com/dealbase/dealbase/
error: failed to push some refs to 'https://github.com/dealbase/dealbase'

如果我从 hudson 用户处执行“ssh -v git@github.com”,我可以成功地向 GitHub 进行身份验证(这也很有意义,因为我可以从私人仓库中提取/克隆)。我的印象是,这个 git push 在进行推送时试图使用 WebDAV/run over HTTP 或其他东西?我的 .gitconfig 与系统上的另一个用户(我的常规非 hudson 用户)相同,可以成功推送标签。

【问题讨论】:

  • 它看起来确实在尝试使用 http。在您的.git/config 中为origin 提供的URL 的格式是什么?如果它以http://(或https://)开头,那就是你的问题——你想要一个git:// 地址。请注意,如果您通过克隆创建存储库,则此地址是从您克隆的内容中复制的 - 在克隆过程中很容易意外使用 http 而不是 git,而不会意识到您已经做了一些永久性的事情。
  • Jefromi,谢谢,我相信就是这样,它以 https 开头,而不是 git。谢谢!

标签: git ubuntu ssh hudson github


【解决方案1】:

如果您不想手动编辑您的 .git/config 文件(或者害怕将其弄乱),您可以使用 git remote 命令来编辑您的远程存储库列表。

git remote show 将列出本地存储库知道的远程存储库,git remote show <reponame> 将显示给定存储库的详细信息(如推送 URL)。您可以git remote rm <reponame>git remote add <reponame> <repourl> 将其重置为您的github ssh URL。

【讨论】:

  • git remote set-url <reponame> <repourl> 更改它而不删除-重新创建它。
【解决方案2】:

查看.git/config(不是~/.gitconfigremote 部分并确保它具有正确的url 值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-16
    • 1970-01-01
    • 2011-02-11
    • 2020-01-08
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多