# git history in a file

3 messages from 2015-07-24 to 2015-07-24. Participants: Josh Boyer, Andreas Schwab.
Thread: https://gitlist.dev/t/39930

## Josh Boyer, 2015-07-24 12:16

Subject: git history in a file
Message-ID: <CA+5PVA6S69ZU5Q432PK3DiPGkT=00tAtgSzJaYHyXLkHkg9FHw@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B5PVA6S69ZU5Q432PK3DiPGkT%3D00tAtgSzJaYHyXLkHkg9FHw%40mail.gmail.com

```
Hello,

I'm trying to figure out how to generate a file that contains the git
history and changes from one revision to another, such that when the
file is applied to a different tree starting at the same ancestor, the
resulting tree is identical.

E.g. git <whatever> v4.2-rc3..master

would produce this file, and then:

git <apply whatever> <file>

run on a tree which is currently at 4.2-rc3 would result in an identical HEAD.

Originally I thought git-format-patch would be sufficient, however it
does not contain merge commits and the resulting commit shas seem like
they would be inaccurate.  Is there a way to do this?

I realize one could just git fetch/pull from tree A to tree B, but the
usecase here is more complicated.  Please CC me on replies as I am not
subscribed.

josh

```

## Andreas Schwab, 2015-07-24 12:46

Subject: Re: git history in a file
Message-ID: <87wpxp4tae.fsf@igel.home>
URL: https://gitlist.dev/e/87wpxp4tae.fsf%40igel.home
In-Reply-To: <CA+5PVA6S69ZU5Q432PK3DiPGkT=00tAtgSzJaYHyXLkHkg9FHw@mail.gmail.com>

```
Josh Boyer <jwboyer@fedoraproject.org> writes:

> I'm trying to figure out how to generate a file that contains the git
> history and changes from one revision to another, such that when the
> file is applied to a different tree starting at the same ancestor, the
> resulting tree is identical.

See git-bundle(1).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Josh Boyer, 2015-07-24 13:02

Subject: Re: git history in a file
Message-ID: <CA+5PVA70T5NpmYPBrSY7_2C2_-nSMT898kboa8_Xnv+6Borgsw@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B5PVA70T5NpmYPBrSY7_2C2_-nSMT898kboa8_Xnv%2B6Borgsw%40mail.gmail.com
In-Reply-To: <87wpxp4tae.fsf@igel.home>

```
On Fri, Jul 24, 2015 at 8:46 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Josh Boyer <jwboyer@fedoraproject.org> writes:
>
>> I'm trying to figure out how to generate a file that contains the git
>> history and changes from one revision to another, such that when the
>> file is applied to a different tree starting at the same ancestor, the
>> resulting tree is identical.
>
> See git-bundle(1).

Thanks.  That does indeed seem like what I'm looking for.

josh

```
