[git-users] How do I modify the commit message (not the topmost one) of a git commit?

2013-05-04 Thread Norah Jones
Hi, 

I did a series of commits and now I find one of my commit (not the topmost one) 
has an incorrect commit message. How can I change that specific one? I believe 
git commit --amend works only for the last commit.


Thanks,
Norah Jones


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] How do I modify the commit message (not the topmost one) of a git commit?

2013-05-04 Thread William Seiti Mizuta
Hi Norah,

you can use the interactive rebase to change a commit message. For this,
get the commit's hash of the commit before the one you want to change. For
example, if you have the following commits:

A - B - C - D - E - F

where F is the newest commit and you want to change the commit message from
commit D, then you will need to get the hash from commit C. With this, use
the command git rebase -i hash-C. It will open an editor with commits D, E
and F. To change D commit's message, change the word that appears in front
of D from pick to reword.


William Seiti Mizuta
@williammizuta
Caelum | Ensino e Inovação
www.caelum.com.br


On Sat, May 4, 2013 at 3:31 AM, Norah Jones nh.jone...@gmail.com wrote:

 Hi,

 I did a series of commits and now I find one of my commit (not the topmost
 one) has an incorrect commit message. How can I change that specific one? I
 believe git commit --amend works only for the last commit.


 Thanks,
 Norah Jones


 --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to git-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.