Git推动现有的回购到一个新的和不同的远程回购服务器? [英] Git push existing repo to a new and different remote repo server?

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

问题描述

假设我有一个关于 git.fedorahosted.org的存储库,我想将它克隆到我在github上的帐户中,让自己的操场摆脱fedorahosted上更官方的回购。
最初复制的步骤是什么?
在github中有这个很好的fork按钮,但我不能明显地使用它。



我将如何跟踪fedorahosted回购GitHub的一个? 克隆从fedorahosted到您的本地机器的回购。

  • git remote rename origin upstream
  • git remote add origin URL_TO_GITHUB_REPO
  • git push origin master

  • 现在您可以像使用其他github回购一样使用它了。要从上游获取补丁,只需运行 git pull upstream master&& git push origin master


    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.

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

    解决方案

    1. Create a new repo at github.
    2. Clone the repo from fedorahosted to your local machine.
    3. git remote rename origin upstream
    4. git remote add origin URL_TO_GITHUB_REPO
    5. 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天全站免登陆