假设我在git.fedorahosted.org上有一个存储库,我想把它克隆到我在github上的帐户中,这样除了在fedorahosted上更“官方”的repo之外,我还可以有自己的游乐场。最初复制它的步骤是什么?在github中有一个很好的"fork“按钮,但由于显而易见的原因,我不能使用它。
我如何将fedorahosted repo中的更改跟踪到github中?
发布于 2013-09-12 05:51:00
这个问题有一个已删除的答案,其中有一个有用的链接:https://help.github.com/articles/duplicating-a-repository
要点是
0. create the new empty repository (say, on github)
1. make a bare clone of the repository in some temporary location
2. change to the temporary location
3. perform a mirror-push to the new repository
4. change to another location and delete the temporary location
OP的例子:
在您的本地计算机上
$ cd $HOME
$ git clone --bare https://git.fedorahosted.org/the/path/to/my_repo.git
$ cd my_repo.git
$ git push --mirror https://github.com/my_username/my_repo.git
$ cd ..
$ rm -rf my_repo.git
发布于 2018-08-28 15:12:17
如果您有现有的Git存储库:
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/newproject
git push -u origin --all
git push -u origin --tags
发布于 2015-08-19 08:03:20
您真的想简单地推送本地存储库(及其本地分支等)吗?到新的遥控器,或者你真的想在新的遥控器上镜像旧的遥控器(及其所有的分支,标签等)?如果是后者,在How to properly mirror a git repository上有一个很棒的博客。
我强烈建议你阅读博客,了解一些非常重要的细节,但简短的版本是这样的:
在新目录中运行以下命令:
git clone --mirror git@example.com/upstream-repository.git
cd upstream-repository.git
git push --mirror git@example.com/new-location.git
https://stackoverflow.com/questions/5181845
复制相似问题