GIT PULL正在工作,但GIT PUSH不是吗?

时间:2015-01-22 16:33:39

标签: 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密钥是准确的。我只有一个ssh密钥,所以我认为git不太可能使用错误的密钥。 “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

1 个答案:

答案 0 :(得分:2)

您可能需要配置push refs规范以确保对所需分支进行推送。也许你只对某些分支机构拥有推送权限。