# git rebase -i <first_commit_in_repository>

9 messages from 2009-10-26 to 2009-10-28. Participants: eschvoca, Mike Hommey, Erik Faye-Lund, Dirk Süsserott, Allan Caffee, Johannes Schindelin.
Thread: https://gitlist.dev/t/21360

## eschvoca, 2009-10-26 17:14

Subject: git rebase -i <first_commit_in_repository>
Message-ID: <2b05065b0910261014t4eb93952oc804bcd01b339a84@mail.gmail.com>
URL: https://gitlist.dev/e/2b05065b0910261014t4eb93952oc804bcd01b339a84%40mail.gmail.com

```
Hi,

Is there a way to rewrite history, including the first commit.  It
seems that the first commit can not be modified with a rebase.

Cheers.

```

## Mike Hommey, 2009-10-26 17:24

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <20091026172412.GA30467@glandium.org>
URL: https://gitlist.dev/e/20091026172412.GA30467%40glandium.org
In-Reply-To: <2b05065b0910261014t4eb93952oc804bcd01b339a84@mail.gmail.com>

```
On Mon, Oct 26, 2009 at 01:14:47PM -0400, eschvoca wrote:
> Hi,
> 
> Is there a way to rewrite history, including the first commit.  It
> seems that the first commit can not be modified with a rebase.

Unfortunately, there is no way to do so, except by hand, by checking out
the first commit, amend it, and then rebase.

Mike

```

## Erik Faye-Lund, 2009-10-26 17:25

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <40aa078e0910261025l1ad7bf8ex27fd62072a317f9d@mail.gmail.com>
URL: https://gitlist.dev/e/40aa078e0910261025l1ad7bf8ex27fd62072a317f9d%40mail.gmail.com
In-Reply-To: <2b05065b0910261014t4eb93952oc804bcd01b339a84@mail.gmail.com>

```
On Mon, Oct 26, 2009 at 6:14 PM, eschvoca <eschvoca@gmail.com> wrote:
> Hi,
>
> Is there a way to rewrite history, including the first commit.  It
> seems that the first commit can not be modified with a rebase.

This question is answered in the FAQ:
http://git.or.cz/gitwiki/GitFaq#HowdoIedittherootcommit.3F

-- 
Erik "kusma" Faye-Lund

```

## eschvoca, 2009-10-26 18:08

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <2b05065b0910261108g4a8448c8x295606a8d33612f5@mail.gmail.com>
URL: https://gitlist.dev/e/2b05065b0910261108g4a8448c8x295606a8d33612f5%40mail.gmail.com
In-Reply-To: <40aa078e0910261025l1ad7bf8ex27fd62072a317f9d@mail.gmail.com>

```
On Mon, Oct 26, 2009 at 1:25 PM, Erik Faye-Lund
<kusmabite@googlemail.com> wrote:
> On Mon, Oct 26, 2009 at 6:14 PM, eschvoca <eschvoca@gmail.com> wrote:
>> Hi,
>>
>> Is there a way to rewrite history, including the first commit.  It
>> seems that the first commit can not be modified with a rebase.
>
> This question is answered in the FAQ:
> http://git.or.cz/gitwiki/GitFaq#HowdoIedittherootcommit.3F
>

Thanks Eric.  Hopefully someone will enhance rebase to handle the root commit.

```

## Dirk Süsserott, 2009-10-26 20:28

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <4AE60669.9080402@dirk.my1.cc>
URL: https://gitlist.dev/e/4AE60669.9080402%40dirk.my1.cc
In-Reply-To: <2b05065b0910261108g4a8448c8x295606a8d33612f5@mail.gmail.com>

```
Am 26.10.2009 19:08 schrieb eschvoca:
> On Mon, Oct 26, 2009 at 1:25 PM, Erik Faye-Lund
> <kusmabite@googlemail.com> wrote:
>> On Mon, Oct 26, 2009 at 6:14 PM, eschvoca <eschvoca@gmail.com> wrote:
>>> Hi,
>>>
>>> Is there a way to rewrite history, including the first commit.  It
>>> seems that the first commit can not be modified with a rebase.
>> This question is answered in the FAQ:
>> http://git.or.cz/gitwiki/GitFaq#HowdoIedittherootcommit.3F
>>
> 
> Thanks Eric.  Hopefully someone will enhance rebase to handle the root commit.

Hi,

probably my approach could help you in the future: When I create a new 
repo (git init) I firstly create an initial commit with nothing else 
than an initial commit, i.e.:

$ git init
$ echo "initial" > initial.commit
$ git add initial.commit
$ git commit -m "Initial commit"

and then secondly

$ git add .
$ git commit -m "*REAL* initial commit"

Afterwards I have a repo with an initial commit that only contains one 
file (initial.commit) and the "real" initial commits thereafter. Maybe 
that's a solution for you.

Cheers,
     Dirk

```

## Allan Caffee, 2009-10-26 20:47

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <b2e43f8f0910261347m38ccb608nb5858ff1dc432b33@mail.gmail.com>
URL: https://gitlist.dev/e/b2e43f8f0910261347m38ccb608nb5858ff1dc432b33%40mail.gmail.com
In-Reply-To: <4AE60669.9080402@dirk.my1.cc>

```
2009/10/26 Dirk Süsserott <newsletter@dirk.my1.cc>:
> Am 26.10.2009 19:08 schrieb eschvoca:
> Hi,
>
> probably my approach could help you in the future: When I create a new repo
> (git init) I firstly create an initial commit with nothing else than an
> initial commit, i.e.:
>
> $ git init
> $ echo "initial" > initial.commit
> $ git add initial.commit
> $ git commit -m "Initial commit"

I don't think this is actually necessary.  You should just be able to do:
$ git init
$ git commit --allow-empty -m "Initial commit (empty)"

--
Allan

```

## Johannes Schindelin, 2009-10-26 21:11

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <alpine.DEB.1.00.0910262210480.4985@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0910262210480.4985%40pacific.mpi-cbg.de
In-Reply-To: <2b05065b0910261108g4a8448c8x295606a8d33612f5@mail.gmail.com>

```
Hi,

On Mon, 26 Oct 2009, eschvoca wrote:

> On Mon, Oct 26, 2009 at 1:25 PM, Erik Faye-Lund
> <kusmabite@googlemail.com> wrote:
> > On Mon, Oct 26, 2009 at 6:14 PM, eschvoca <eschvoca@gmail.com> wrote:
> >> Hi,
> >>
> >> Is there a way to rewrite history, including the first commit.  It
> >> seems that the first commit can not be modified with a rebase.
> >
> > This question is answered in the FAQ:
> > http://git.or.cz/gitwiki/GitFaq#HowdoIedittherootcommit.3F
> 
> Thanks Eric.  Hopefully someone will enhance rebase to handle the root 
> commit.

If you cannot do it yourself, you can always offer to bribe^Wpay somebody 
to do it for you.

Ciao,
Dscho

```

## eschvoca, 2009-10-27 00:27

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <2b05065b0910261727g75e4330fn23ed6c633114e689@mail.gmail.com>
URL: https://gitlist.dev/e/2b05065b0910261727g75e4330fn23ed6c633114e689%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0910262210480.4985@pacific.mpi-cbg.de>

```
Hi,

On Mon, Oct 26, 2009 at 5:11 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 26 Oct 2009, eschvoca wrote:
>
>> On Mon, Oct 26, 2009 at 1:25 PM, Erik Faye-Lund
>> <kusmabite@googlemail.com> wrote:
>> > On Mon, Oct 26, 2009 at 6:14 PM, eschvoca <eschvoca@gmail.com> wrote:
>> >> Hi,
>> >>
>> >> Is there a way to rewrite history, including the first commit.  It
>> >> seems that the first commit can not be modified with a rebase.
>> >
>> > This question is answered in the FAQ:
>> > http://git.or.cz/gitwiki/GitFaq#HowdoIedittherootcommit.3F
>>
>> Thanks Eric.  Hopefully someone will enhance rebase to handle the root
>> commit.
>
> If you cannot do it yourself, you can always offer to bribe^Wpay somebody
> to do it for you.
>
> Ciao,
> Dscho
>

I can do the workaround myself but not the production ready patch.
Right now the only bribe I can offer is that it might be less work
writing the patch than supporting this corner case with answering
questions and writing a FAQ entry about it.  It also would make the
awesome rebase -i even awesomer :)  I know, a disappointing bribe but
from a thankful user.

Thanks

```

## Dirk Süsserott, 2009-10-28 19:24

Subject: Re: git rebase -i <first_commit_in_repository>
Message-ID: <4AE89A81.9040407@dirk.my1.cc>
URL: https://gitlist.dev/e/4AE89A81.9040407%40dirk.my1.cc
In-Reply-To: <b2e43f8f0910261347m38ccb608nb5858ff1dc432b33@mail.gmail.com>

```
Am 26.10.2009 21:47 schrieb Allan Caffee:
> 2009/10/26 Dirk Süsserott <newsletter@dirk.my1.cc>:
>> Am 26.10.2009 19:08 schrieb eschvoca:
>> Hi,
>>
>> probably my approach could help you in the future: When I create a new repo
>> (git init) I firstly create an initial commit with nothing else than an
>> initial commit, i.e.:
>>
>> $ git init
>> $ echo "initial" > initial.commit
>> $ git add initial.commit
>> $ git commit -m "Initial commit"
> 
> I don't think this is actually necessary.  You should just be able to do:
> $ git init
> $ git commit --allow-empty -m "Initial commit (empty)"
> 

Allan,

that works great and is not as cumbersome as my solution.
Thank you!

Dirk

```
