0

我正在关注Dan Eden 的 Github 工作流程指南。尝试从远程将我的更改推送到 Github 时,我遇到了一个问题,使用git push -u origin master. 我已将所有文件添加到舞台并提交它们,当我使用上面的命令时,它会返回:

To git@github.com:tomoakley/5-lines.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:tomoakley/5-lines.git'
hint: Updates were rejected because the tip of your current branch is behind 
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull因此,正如它所建议的那样,我尝试使用它,它会返回:

git: 'pull' is not a git command. See 'git --help'.

Did you mean this?
    shell

我已经联系了我的两个网络主机,他们说这不是 Git 安装的问题,而是我的 ssh 密钥的问题(使用ssh -T git@github.com带有正常身份验证消息的返回),所以不可能这样。我还联系了 Github,目前正在调查中。Github 支持人员告诉我使用我现在正在做的SSH 代理转发。

关于我的服务器和 git 的一些细节:

  • git --version: git 版本 1.7.12
  • git --exec-path:/usr/local/libexec/git-core

感谢任何回答的人:)

4

1 回答 1

0

This answer to a similar question建议修复 /usr/local/libexec 目录的权限

sudo chmod a+rx /usr/local/libexec

不过,不确定它是否适用于您的情况。

另一种选择是将 GIT_EXEC_PATH 变量添加到您的 .bashrc 中(将其添加到底部):

export GIT_EXEC_PATH=/usr/local/libexec/git-core
于 2013-02-24T18:39:27.800 回答