Git rebase - Edit the root commit in Git

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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)?

Answers

Assuming that you have a clean working tree, you can do the following.

# checkout the root commit
git checkout <sha1-of-root>

# amend the commit
git commit --amend

# rebase all the other commits in master onto the amended root
git rebase --onto HEAD HEAD master

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/2119480/edit-the-root-commit-in-git

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils