简体   繁体   English

从另一个存储库分支克隆后,推送到私有存储库

[英]Push to private repository after clone from another repository fork

I am completely new to Github... 我对Github完全陌生...

I have been learning Android from udacity and I cloned one of the forks from the public repository. 我一直在从udacity学习Android,并且从公共存储库中克隆了其中一个分支。

Now, I want to create my own private repository and push the files to it but it always tries to push them to the udacity repository instead of mine. 现在,我想创建自己的私有存储库并将文件推送到其中,但它总是尝试将其推送到udacity存储库而不是我的存储库。

Here are the commands I used: 这是我使用的命令:

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

But it just keeps returning this: 但是它一直在返回:

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

Please help.... 请帮忙....

The error says you don't have rights to push there. 该错误表明您无权将其推送到该位置。

Most probably, you have to fix your repository url. 最有可能的是,您必须修复您的存储库URL。

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

Then it will ask you to provide the credentials. 然后它将要求您提供凭据。 Later you can get rid of that using SSH urls. 稍后,您可以使用SSH网址摆脱它。 Here is a nice article on how to get started using SSH keys. 是一篇不错的文章,介绍如何开始使用SSH密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM