【问题标题】:Eclipse Git Push to Upstream WrongEclipse Git 推送到上游错误
【发布时间】:2012-06-25 20:57:52
【问题描述】:

我克隆https://github.com/java093/springside4.git 并在 eclipse 中成功提交本地更改的文件。然后我使用 Team->Push to Upstream 它显示错误: 推送期间发生内部异常:https://github.com/java093/springside4.git: git-receive-pack not allowed

我该如何解决这个问题。在我的另一台电脑上使用相同的 git url(https://github.com/java093/springside4.git) 成功。

  1. 我的 Eclipse 版本 eclipse-jee-helios-SR2-win32。
  2. 我已在我的 github 帐户中设置了有关此笔记本的 SSH 密钥。但是我如何检查它是否已成功设置。
  3. 在哪里可以找到 git-receive-pack not allowed 日志。

【问题讨论】:

标签: eclipse git


【解决方案1】:

检查您是否在“其他 PC”上为上游 repo 使用相同的远程地址:

你可以使用:

  • 一个 https 地址,就像你做的那样:但是你的 ssh 密钥将不会参与
  • ssh 地址:git@github.com:[repo_owner_username]/[repo_name].git 并使用配置文件作为illustrated here

底线是:如果您希望使用 ssh 密钥,则必须使用 ssh url,而不是 https (这将使用 GitHub 凭据,即您的 GitHub 登录名和密码,在 Windows 上使用 _netrc 或Unix 上的.netrc,如“Syncing with github”中所述,而不是您的 ssh 密钥)。

正如 OP 在下面提到的,此实例中的问题类似于 bb describes:

使用非交互式 shell 时 Git PATH 问题的解决方案

> 在 Linux 上

git config remote.origin.uploadpack '/home/<user name>/bin/git-upload-pack'
git config remote.origin.receivepack '/home/<user name>/bin/git-receive-pack'

(或者,在 OP 的情况下考虑服务器上的 git 安装路径:

git config remote.origin.uploadpack '/home/bin/git-upload-pack'
git config remote.origin.receivepack '/home/bin/git-receive-pack'

)

> 在 Windows 上

git config remote.origin.uploadpack 'libexec/git-core/git-upload-pack'
git config remote.origin.receivepack 'libexec/git-core/git-receive-pack'

上述解决方案运行良好,但假设您已经有一个本地 git 存储库正在跟踪服务器上的远程存储库。
克隆存储库将失败并出现相同的错误。。 p>

git clone -u /home/<user>/bin/git-upload-pack <user>@<host>:/<path-to-repo>
git clone -u /home/bin/git-upload-pack <user>@<host>:/<path-to-repo>

【讨论】:

  • Tahnks 很多。这个问题是因为 git-receive-pack(push) 命令设置不正确。我已经解决了:git config remote.origin.uploadpack /home/bin/git-上传包
【解决方案2】:

非常感谢。这个问题是因为 git-receive-pack(push) 命令设置不正确。 我已经解决了:git config remote.origin.uploadpack /home/bin/git-upload-pack

GIT : "git-upload-pack: command not found" while pushing to remote server

【讨论】:

  • +1。良好的反馈。我的答案中包含了其他元素。
【解决方案3】:

在大多数情况下,这是由于缺少身份验证详细信息:

  1. 打开配置。
  2. 点击 URI 字段的更改按钮。
  3. 在更改弹出窗口时确保您的 URI 路径类似于: "https://github.com/[repo_username]/[repo_name].git"
  4. 选择 https 协议
  5. 添加 repo_username 和密码。

希望它能解决问题。

【讨论】:

    【解决方案4】:

    检查您是否拥有对此存储库的“写入”权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-24
      • 2023-03-16
      • 2020-09-26
      • 2016-08-10
      • 2020-09-16
      • 1970-01-01
      • 2016-12-30
      • 2015-11-05
      相关资源
      最近更新 更多