I have a bunch of git commits that need to be modified. I haven't pushed any of them yet, I've simply been doing:
git add .
git commit -m "message 1"
git add .
git commit -m "message 2"
git add .
git commit -m "message 3"
git add .
git commit -m "message 4"
Now I'm trying to add a line to all of these commits..
I thought you would do it this way:
1) Get the commit numbers:
$] git log
commit 931824f116637cf0f4d7dea98828f9cdfc6b9157
Author: ...
Date: Tue Feb 4 17:30:19 2014 -0800
message 1
commit 726adac71a0d8fdac4f62663e6081f1e784e4805
Author: ...
Date: Tue Feb 4 16:25:17 2014 -0800
message 2
commit d8aab763f2d2603fb1935648f1ffe80e26039209
Author: ...
Date: Tue Feb 4 10:53:19 2014 -0800
message 3
commit 931824f116637cf0f4d7dea98828f9cdfc6b9157
Author: ...
Date: Tue Feb 4 17:30:19 2014 -0800
message 4
2) Do "git commit --amend -c [commit number]"
git commit --amend -c 931824f116637cf0f4d7dea98828f9cdfc6b9157
git commit --amend -c 726adac71a0d8fdac4f62663e6081f1e784e4805
git commit --amend -c d8aab763f2d2603fb1935648f1ffe80e26039209
git commit --amend -c 931824f116637cf0f4d7dea98828f9cdfc6b9157
3) When the editor comes up, I type "i" to insert, then add some text to the message, then type ":wq" to save and quit...
But then the editor doesn't save the changes I've made to the commit messages... I do "git log" and the message still looks the same! It still says "message 1" eventhough I changed it to be "message 1 more text"...
When I re-run "git commit --amend..." for the same command, it still says "message 1", also... so it seems that it has had absolutely no effect..
Anything I'm doing wrong? I have correct "rights" to write to the files :(
git rebase -i HEAD~5...