GIT PULL 有效,但 GIT PUSH 无效?

标签 git

我在推送 git 时遇到问题。每当我执行“git pull”时,它都会从我需要的存储库中提取。但是,当我提交后执行“git push”时,出现以下错误:

  Permission denied
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.

我验证了我的 ssh key 是准确的。我只有一个 ssh key ,所以我认为 git 不太可能使用错误的 key 。 “git pull”效果很好。 “我的 git config --list”显示以下内容:

  user.name=myusername
  user.email=myemail
  push.default=current
  remote.origin.url=theCorrectURL
  branch.thebranchiwannapushto.remote=origin
  branch.thebranchiwannapushto.merge=refs/heads/branchname
  mergetool.prompt=false

最佳答案

您可能需要配置推送引用规范以确保推送到所需的分支。也许您只有某些分支的推送权限。

关于GIT PULL 有效,但 GIT PUSH 无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28093935/

相关文章:

python - gitpython 和 git diff

git - 在 Colab 中将文件推送到 Git 时出错 : fatal: could not read Username for 'https://github.com' : No such device or address

git - .git 目录中有这么多文件。慢备份

android - "/usr/local/bin/git": error=2, Android Studio 没有那个文件或目录

ruby - Rspec 不告诉我它的

git - 如何在我的 git 服务器上获得类似 github 的 ssh 访问行为

git - 我想更改上一次提交的 Git 提交消息

git - ssh-add 创建错误连接到代理 : Connection timed out (Windows 10)

git - 在 git 中使用 osx 钥匙串(keychain)

git - 如何将另一个文件添加到我的 pull 请求中?