From: "Jike Song" <albcamus@gmail.com>
To: git <git@vger.kernel.org>
Subject: Re: how to edit commit message in history
Date: Fri, 16 Jan 2009 12:09:27 +0800 [thread overview]
Message-ID: <df9815e70901152009i3bd717d0t6c20c41e9be19552@mail.gmail.com> (raw)
In-Reply-To: <20090116035714.GA6984@b2j>
On Fri, Jan 16, 2009 at 11:57 AM, bill lam <cbill.lam@gmail.com> 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
next prev parent reply other threads:[~2009-01-16 4:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 3:57 how to edit commit message in history bill lam
2009-01-16 4:09 ` Jike Song [this message]
2009-01-16 4:31 ` thestar
2009-01-16 11:18 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=df9815e70901152009i3bd717d0t6c20c41e9be19552@mail.gmail.com \
--to=albcamus@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).