後のコミットからメッセージを変更する方法があります。
git commit --amend # for the most recent commit
git rebase --interactive master~2 # but requires *parent*
最初のコミット(親がない)のコミットメッセージをどのように変更できますか?
後のコミットからメッセージを変更する方法があります。
git commit --amend # for the most recent commit
git rebase --interactive master~2 # but requires *parent*
最初のコミット(親がない)のコミットメッセージをどのように変更できますか?
クリーンな作業ツリーがあると仮定すると、次のことができます。
# 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
使用できますgit filter-branch
:
cd test
git init
touch initial
git add -A
git commit -m "Initial commit"
touch a
git add -A
git commit -m "a"
touch b
git add -A
git commit -m "b"
git log
-->
8e6b49e... b
945e92a... a
72fc158... Initial commit
git filter-branch --msg-filter \
"sed \"s|^Initial commit|New initial commit|g\"" -- --all
git log
-->
c5988ea... b
e0331fd... a
51995f1... New initial commit