开发者

Merge an independent project into a greater one without losing history

I have an independent project, t开发者_JAVA技巧he CPAN module ExtUtils::MakeMaker. It also lives inside Perl. Generally, a release of MakeMaker will be made and Perl will integrate that tarball into its repository. But sometimes Perl will change its copy of MakeMaker and that change will have to go into the CPAN repository. Also the history of MakeMaker inside Perl extends before MakeMaker in github.

Rather than having two repositories, I would like there to be one. To wit, simply commit directly to perl5.git/cpan/ExtUtils-MakeMaker. This solves the release integration problem. The problem becomes preserving history, code archeology is very important to MakeMaker. The github repository has most of the history of MakeMaker. perl5.git has its own history of MakeMaker, also unique and interesting. The two histories overlap.

The problem is this: how do I merge the github MakeMaker repository into the Perl repository while still preserving history for archeological use? Preferably a solution that doesn't involve manually slogging through individual changes (there's thousands).

Thank you.


You can use submodules, or you can use subtree merge (perhaps with the help of third party git subtree tool).


Note: since git1.7.11 (June 2012), there is a third option with the git subtree script (previously developed on GitHub by apenwarr, now merged into mainline git)

That way, you can merge one repo (and its history) in another, keeping the option to extract its history later on (as opposed to the subtree merge).


Check if your repository allows you to tag and branch your code, and check out what they are exactly, they will solve your problems for sure ;-)

Regards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜