2015-10-06 76 views
1

克隆后,我完全新的Github上...推到私人仓库从另一个存储库叉

我已经从udacity学习Android和我克隆从公共库叉之一。

现在,我想创建自己的私有存储库并将文件推送到它,但它总是尝试将它们推送到udacity存储库而不是我的。

下面是我使用的命令:

git remote add origin <my_git_url> 
git add . 
git commit -m "First Commit" 
git push origin master 

但它只是不断返回这一点:

remote: Permission to udacity/Sunshine-Version-2.git denied to xxxx. 
fatal: unable to access 'https://github.com/udacity/Sunshine-Version-2.git/': The requested URL returned error: 403 

请帮助....

回答

1

错误说你没有权利推在那里。

很可能,您必须修复您的存储库网址。

git remote remove origin 
git remote add origin https://github.com/your-username/your-repository 
git push origin master 

然后它会要求您提供凭据。稍后,您可以使用SSH网址摆脱此问题。 Here是如何开始使用SSH密钥的不错文章。

+0

谢谢,这真的很有帮助。我遇到了另一个问题,因为我试图推动克隆分支。找到答案在这里http://stackoverflow.com/questions/2765421/push-a-new-local-branch-to-a-remote-git-repo-and-track-it-too – coffeeak

+0

@ user1109363很高兴帮助!别客气。 –

相关问题