2017-10-17 156 views
2

当我尝试将新文件推送到分叉存储库时,'git push'命令失败。我得到的错误如下: ! [远程拒绝]主 - >主(权限被拒绝) 我是分叉库的所有者,所以我不知道为什么我得到这个错误。我很感激帮助。 TNX分叉库中的Git推送失败

回答

0

尝试

git push origin master 

,如果这是你

+0

谢谢它不适用于我不幸的。 –

+0

你有没有签出[这个问题]修复(https://stackoverflow.com/questions/25545613/how-can-i-push-to-my-fork-from-a-clone-of-the-original -repo)?类似的问题,我认为 – person

0

尝试以下步骤

混帐配置--global --edit

推到这个分叉库第一次然后将以下内容添加到conf文件中

[credential] 
    helper = osxkeychain 
    useHttpPath = true 
+0

感谢它不适用于我不幸的。 –

+0

运行git remote -v你看到了什么? –

1

您确定您正在推向右边的遥控器吗?运行命令git remote -v并确认origin远程是您有权访问的存储库。如果不是,按下你有机会获得像遥控:

git push -u <remote name> <branch name> 

这将设置你的本地分支来跟踪给定的远程分支,使git push将推动在默认情况下。如果已更改,您可能还需要更改push.default的设置。

0

确保远程是你的资料库:

$ git remote -v 
origin https://github.com/octocat/Spoon-Knife.git (fetch) 
origin https://github.com/octocat/Spoon-Knife.git (push) 

如果这不是你的,改变这样的:

$ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git 
$ git remote -v 
origin https://github.com/USERNAME/REPOSITORY.git (fetch) 
origin https://github.com/USERNAME/REPOSITORY.git (push) 

的然后尝试再次推

$ git push origin master