如何将克隆的git仓库上传到github上自己的git仓库?

问题描述 投票:0回答:2

我从 github 克隆了一个项目。现在我想将其上传到 github 上我自己的私人存储库以进行处理。但是克隆的存储库在原始键中具有克隆项目的值。将此项目上传到我自己的私人存储库的最佳实践是什么?我已经阅读了 git 文档的德语版本(https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes),但还没有找到解决方案。

git github repository push clone
2个回答
5
投票

您可以按照以下步骤操作

git remote -v
git remote remove origin
git remote -v   //to check if it was remove

转到 Github,创建一个新存储库。

git remote add origin <the new repository>
git remote -v

2
投票

通过命令

git remote add newrepo NewRepoURL

您将有一个名为

newrepo
(您可以以任何您想要的方式命名)的附加遥控器指向 NewRepoURL。要push(不是upload),您需要分支到新的远程do

git push newrepo main
© www.soinside.com 2019 - 2024. All rights reserved.