我在推送 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/