替换GitHub回购,同时保留问题,wiki等 [英] Replace GitHub repo while preserving issues, wiki, etc

查看:142
本文介绍了替换GitHub回购,同时保留问题,wiki等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub上有一个回购,其中有很多问题。我想用新的代码替换该代码库的整个代码库,但是我想保留所有先前的信息。



什么是做的最好的方式,不会弄乱代码或GitHub的?


解决方案
  • cd 放入新存储库添加原点git@github.com名称:myusername / myrepository (替换名为myUsername &安培; myrepository 因此)
  • git push --force来源主

  • 可能会删除其他远程分支和推新的。



  • 这将强制替换远程仓库中的所有内容。要非常小心,没有回头路。


    I have a repo on GitHub with a lot of issues there. I want to replace the entire code base of that repo with a new one but I want to keep all the previous information.

    What's the best way of doing that without messing up the code nor GitHub?

    解决方案

    • cd into "new" repository
    • git remote add origin git@github.com:myusername/myrepository (replacing myusername & myrepository accordingly)
    • git push --force origin master
    • Possibly delete other remote branches and push new ones.

    This will forcefully replace everything in the remote repository with what you have locally. Be very careful, there is no going back.

    这篇关于替换GitHub回购,同时保留问题,wiki等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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