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

Re: Edit log message after commit

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Sep 29, 2005, 08:35 UTC
Message-ID
<tnxbr2ce0fo.fsf@arm.com>
In-Reply-To
<dhfjcu$36f$1@sea.gmane.org>
Kevin Leung <hysoka@gmail.com> wrote:
> Is there any method to edit the log message after committed? I
> couldn't find any information in Documentation and in git mailing
> list.

As the others said, a commit object is immutable but it can be replaced with a new one and the path from HEAD changed. If you need to do this often, have a look at StGIT. It allows you to create patches as git commit objects and indefinitely edit them (both file changes and commit information like log messages, author etc.).

In the latest snapshot, I also added a commit command to permanently store the patches into the repository after which you won't be able to edit them anymore (that's useful for maintainers using StGIT, not only contributors).

-- 
Catalin
Previous: Junio C HamanoNext: Kevin Leung
Message 8 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.