# RFC: git rebase -i and root commits

3 messages from 2008-07-23 to 2008-07-23. Participants: Eric Raible, Stephan Beyer, Johannes Schindelin.
Thread: https://gitlist.dev/t/14610

## Eric Raible, 2008-07-23 01:58

Subject: RFC: git rebase -i and root commits
Message-ID: <loom.20080723T013019-412@post.gmane.org>
URL: https://gitlist.dev/e/loom.20080723T013019-412%40post.gmane.org

```
My normal workflow is to create a .gitignore in my initial commit.

When I later realize that I've forgotten something from that file
I could of course just commit the changes, but I'd rather use "git rebase -i"
in the normal way to make myself appear smarter than I am.
Especially since this realization usually comes early on
(and certainly before publishing).

But rebase can't go all the way to a root ("fatal: Needed a single revision").
The best I've found is:

1) git checkout -b temp <root commit>
2) echo '*.tmp' >> .gitignore
3) git commit --amend .gitignore
4) git rebase --onto temp <root commit> master

If there really is an asymmetry here and I haven't missed anything
(a large assumption), then what's the best way to think about it?

Is there a role for a default commit (e.g. the sha1 of "") here so that
'rebase -i' can update all commits and not just the ones with parents?

Or should I just get used to it and move on?

Thanks - Eric

```

## Stephan Beyer, 2008-07-23 02:02

Subject: Re: RFC: git rebase -i and root commits
Message-ID: <20080723020232.GF5904@leksak.fem-net>
URL: https://gitlist.dev/e/20080723020232.GF5904%40leksak.fem-net
In-Reply-To: <loom.20080723T013019-412@post.gmane.org>

```
Hi,

Eric Raible wrote:
> My normal workflow is to create a .gitignore in my initial commit.
> 
> When I later realize that I've forgotten something from that file
> I could of course just commit the changes, but I'd rather use "git rebase -i"
> in the normal way to make myself appear smarter than I am.
> Especially since this realization usually comes early on
> (and certainly before publishing).
> 
> But rebase can't go all the way to a root ("fatal: Needed a single revision").

I think this has been fixed recently.

Regards,
  Stephan

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F

```

## Johannes Schindelin, 2008-07-23 09:05

Subject: Re: RFC: git rebase -i and root commits
Message-ID: <alpine.DEB.1.00.0807231103230.2830@eeepc-johanness>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0807231103230.2830%40eeepc-johanness
In-Reply-To: <20080723020232.GF5904@leksak.fem-net>

```
Hi,

On Wed, 23 Jul 2008, Stephan Beyer wrote:

> Eric Raible wrote:
> > My normal workflow is to create a .gitignore in my initial commit.
> > 
> > When I later realize that I've forgotten something from that file
> > I could of course just commit the changes, but I'd rather use "git rebase -i"
> > in the normal way to make myself appear smarter than I am.
> > Especially since this realization usually comes early on
> > (and certainly before publishing).
> > 
> > But rebase can't go all the way to a root ("fatal: Needed a single revision").
> 
> I think this has been fixed recently.

No, it has not.

What has been fixed is that you can cherry-pick a root commit now, not 
rebase onto nothing.

While I am somewhat sympathetic with Eric's use case, I am not sure that 
we should support it with rebase -i.

Ciao,
Dscho

```
