Git 将现有存储库推送到新的和不同的远程存储库服务器? [英] Git push existing repo to a new and different remote repo server?

查看:19
本文介绍了Git 将现有存储库推送到新的和不同的远程存储库服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在 git.fedorahosted.org 上有一个存储库 并且我想将其克隆到我在 github 的帐户中,以便在 Fedorahosted 上拥有更多官方"存储库之外的自己的游乐场.最初复制它的步骤是什么?在 github 中有一个不错的fork"按钮,但由于显而易见的原因我不能使用它.

Say I have a repository on git.fedorahosted.org and I want to clone this into my account at github to have my own playground aside from the more "official" repo on fedorahosted. What would be the steps to initially copy that over? Within github there is this nice "fork" button, but I can't use this for obvious reasons.

我如何将 fedorahosted 存储库中的更改跟踪到 github 存储库中?

And how would I track changes in the fedorahosted repo into the github one?

推荐答案

  1. 在 github 创建一个新的存储库.
  2. 将存储库从 fedorahosted 克隆到本地计算机.
  3. git remote rename origin upstream
  4. git remote add origin URL_TO_GITHUB_REPO
  5. git push origin master

现在您可以像使用任何其他 github 存储库一样使用它.要从上游提取补丁,只需运行 git pull upstream master &&git push origin master.

Now you can work with it just like any other github repo. To pull in patches from upstream, simply run git pull upstream master && git push origin master.

这篇关于Git 将现有存储库推送到新的和不同的远程存储库服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆