Tracking Another Project with Git

In KohaCon I want to track the Lollysite project so I get all of that functionality, but I also want to add some extra bells and whistles to it. This mainly consists of the theme for the KohaCon website but also some config changes to suit the KohaCon application.

To do this, we're going to set up a new branch called lollysite which is going to track the Lollysite master branch. We'll then merge it to master and add our own theme right in there.

Then, every so often - usually when Lollysite releases the next version) - we refetch Lollysite, remerge to master and fix anything which needs doing. These fixes could be anything from conflicts to new features which don't work with the KohaCon theme.

Git Magic

Firstly, get a copy of the KohaCon repo:

 $ git clone git@gitorious.org:kohacon/kohacon.git
 $ cd kohacon

Add Lollysite as a remote:

 $ git remote add lollysite git://gitorious.org/lollysite/lollysite.git
 $ git fetch lollysite

Then set up a tracking branch and push it to the server:

 $ git branch --track lollysite lollysite/master
 $ git checkout lollysite
 $ git push origin lollysite

Take a look around:

 $ git log

Then, merge the lollysite branch over to your local master:

 $ git checkout master
 $ git merge lollysite

If there are any conflicts, then fix them and re-commit.

 $ git push origin master

New version of Lollysite

Finally, if Lollysite releases a new version:

 $ git fetch lollysite
 $ git checkout lollysite
 $ git rebase origin/master

And again, re-merge onto your master:

 $ git checkout master
 $ git merge lollysite

Fix any conflicts/bugs, then re-push:

 $ git push origin master

All done.

Labels: git, lollysite

Inserted: 2009-12-12 09:58 (2 years, 2 months ago)

Your Comment