Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit the root commit in Git?

There's ways to change the message from later commits:

git commit --amend                    # for the most recent commit git rebase --interactive master~2     # but requires *parent* 

How can you change the commit message of the very first commit (which has no parent)?

like image 497
13ren Avatar asked Jan 22 '10 18:01

13ren


People also ask

Can I edit a commit in git?

The git commit --amend command is a convenient way to modify the most recent commit. It lets you combine staged changes with the previous commit instead of creating an entirely new commit. It can also be used to simply edit the previous commit message without changing its snapshot.


1 Answers

As of Git version 1.7.12, you may now use

git rebase -i --root 

Documentation

like image 184
ecdpalma Avatar answered Sep 21 '22 05:09

ecdpalma