如何将我自己的回购交易到新项目中? [英] How to fork my own repo into a new project?

查看:176
本文介绍了如何将我自己的回购交易到新项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个HTML5游戏引擎。我使用Git作为SV和GitHub来实际托管项目。

I was developing an HTML5 game engine. I used Git as the SV and GitHub to actually host the project.

我在设计上做了一些实质性的改变(主要转换到实体系统范例),并且我认为是时候换一个新引擎了。

I've made some substantial changes in the design (mainly switching to the Entity System paradigm), and I think it's time for a new engine.

我想从旧引擎开始,因为我可以使用很多代码。

I would like to base it off the old engine, as there is a lot of code that I can use.

这样做的标准方式是什么?新的引擎将会有一个新的名字,而旧的名字将会被认为是完成的。

What would be the standard way of doing this? The new engine will have a new name, and the old one will be considered "finished".

推荐答案

如果你的意思是你想要一个带有新回购的新项目,但与旧项目共享历史记录,那么简单的方法是

If you mean you want a new project with a new repo, but sharing history with the old one, then the simple way is

$ git clone https://github.com/your_name/old_project new_project
# make new, empty project on GitHub called new_project
$ cd new_project
$ git remote rename origin old_project
$ git remote add origin https://github.com/your_name/new_project
$ git push -u origin

现在你有了一个新的项目,但是在你的本地克隆中,你仍然可以从旧的提交中获得提交,以通过 git cherry-pick 等来修改公共代码。

Now you have a new project, but in your local clone you can still get commits from the old one to get bugfixes to common code with git cherry-pick etc.

这篇关于如何将我自己的回购交易到新项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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