[HOWTO] Using git for mtd

Josh Boyer jwboyer at gmail.com
Sat Apr 22 20:09:55 EDT 2006


On 4/22/06, Jörn Engel <joern at wohnheim.fh-wedel.de> wrote:
> Next version with the FIXMEs filled in.  If anyone has comments, spots
> errors, etc., please tell me.
>
> 1. Clone Linus' tree
>
>   $ git clone git://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git mtd
>
> 2. Change into soon-to-be mtd tree
>
>   $ cd mtd
>
> 3. Setup mtd remotes file
>
>   $ vi .git/remotes/mtd
>   URL: git://git.infradead.org/mtd-2.6
>   Pull: master:mtd
>
> 4. Fetch mtd tree
>
>   $ git fetch mtd
>

Huh?

These look odd to me.  Here are the steps I use (note git 1.3.0 is required)

1. git clone git://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
linux-git

This clones the latest of Linus' tree.

2. git clone --reference linux-git git://git.infradead.org/mtd-2.6.git mtd

This clones the MTD tree, however it uses the previous tree created as
a reference to pull objects from so you don't have two copies of the
exact some git objects lying around.

The reason I do this is two fold.  One is that I want to have the
latest 2.6 tree available to me anyway.  If you don't want/need that,
then just clone the mtd-2.6 tree outright.  The second reason is that
I don't have to do wonky things like 'git fetch mtd'.  A fetch doesn't
merge the changes into the tree.  It just gets the objects.

By using --reference, you get the benefit of sharing the bulk of the
git objects and the simplicity of being able to just do 'git pull' in
both trees to update them.  You also avoid having to locally merge in
the mtd-2.6 changes, which is something David would really like to
avoid.  That way he can pull directly from your tree and doesn't get
extraneous merges.  Which also makes it easier for him to have Linus
pull from _his_ tree, because Linus hates extraneous merges.

The rest of your steps seem fine.

josh




More information about the linux-mtd mailing list