git-fu: long term fork
Monday, August 4th, 2008Here is a great post by Mathieu Martin about how to use Git to maintain and extend a long term fork of a project.
Recently at GiraffeSoft we started a new project, based on another existing project we already had going. We could call this a long term fork.
I’m sure you’ve done this before. You were probably using Subversion, and your project is probably 2 years behind HEAD of the original project.
Your invariants probably looked something like this:
- * These projects will both keep being actively developed in the future;
- * They will have some fundamental differences that will not be reconciled;
- * They will however keep many similarities and we expect that they will benefit from the exchange of some specific patches, as development on both moves forward.
This happens all the time, especially in web development. You find a fantastic open source project to base your project on, but you need to customize and extend it. You also want to easily incorporate future features and bug fixes from the original project as they’re developed.
In days past, this problem could have been solved reasonably well by cloning the central repository and then exchanging patches and applying them manually.
I’ve tried this before. Remember that scene in the Dark Knight where the Joker makes the pencil disappear? It’s kinda like that.
As you’ve guessed already, we’ve decided to try using Git to help manage this long term relationship.
It’s still not going to be easy unless you control both projects, but using a setup like Martin describes will be much easier than checking the man page for patch as you try to merge in new features by hand.
