git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Edit log message after commit

From
TLTony Luck <tony.luck@gmail.com>
Date
Sep 29, 2005, 04:17 UTC
Message-ID
<12c511ca050928211769e4bf8e@mail.gmail.com>
In-Reply-To
<dhfjcu$36f$1@sea.gmane.org>
> Is there any method to edit the log message after committed?
> I couldn't find any information in Documentation and in git mailing list.

No. Once a git object is created it is immutable (since its name is the hash of its contents). If you realise right after you make a commit that you want to change the message, you would have to redo it ... use git diff or git whatchanged to get the details and the diffs, then use git reset to backup, and re-apply.

If you have made subsequent commits, then you'll have to back those out and redo them too.

If you have published your tree, then it's better to live with the 'bad' commit than try to re-write history.

-Tony
Previous: Junio C HamanoNext: Brian Gerst
Message 3 of 9 in “Edit log message after commit”
  1. Kevin LeungSep 29, 2005
  2. Junio C HamanoSep 29, 2005
  3. Tony LuckSep 29, 2005
  4. Brian GerstSep 29, 2005
  5. Kevin LeungSep 29, 2005
  6. Yasushi SHOJISep 29, 2005
  7. Junio C HamanoSep 30, 2005
  8. Catalin MarinasSep 29, 2005
  9. Kevin LeungSep 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.