GIT PULL正在工作,但GIT PUSH不是? [英] GIT PULL is working but GIT PUSH isn't?
问题描述
我在推动git时遇到问题。每当我执行git pull时,它会从我需要的回购中拉出来。但是,当我在提交后执行git push时,出现以下错误:
I'm having problems pushing to git. Whenever I execute "git pull," it pulls from the repo I need. However, when I execute "git push" after committing, I get the following error:
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显示如下:
I verified that my ssh key is accurate. I only have one ssh key so I think it's unlikely that git is using the wrong key. "git pull" works fine. "My git config --list" shows the following:
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
推荐答案
您可能需要配置推送参考规范以确保推送到期望的分支。也许你只有某些分行的推送许可。
You might need to configure push refs specifications to ensure the push is done to the desired branch. Maybe you only have push permission for certain branches.
这篇关于GIT PULL正在工作,但GIT PUSH不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!