Re: how to edit commit message in history

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 16, 2009 at 11:57 AM, bill lam <cbill.lam@xxxxxxxxx> wrote:
> I made some typos in commit messages, how to edit them without
> affecting everything else?
>
> Thanks in advance.

say, it's commit HEAD~2 to be revised.

    git rebase -i HEAD~3

In your editor, you all see something like this:

pick db79377 2nd
pick fa9ced8 3rd
pick b842e49 4nd

# Rebase 1423d77..b842e49 onto 1423d77
#
# Commands:
#  p, pick = use commit
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#



Now change "pick" to "edit" with your typo commit, save it and exit.
You will see something like this:

$ git-rebase -i HEAD~3
Stopped at db79377... 2nd
You can amend the commit now, with

        git commit --amend

Once you are satisfied with your changes, run

        git rebase --continue


Just follow the instructions.

-- 
Thanks,
Jike
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux