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

Re: Retroactively change email signature?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 2, 2008, 21:24 UTC
Message-ID
<alpine.LFD.1.00.0801021316080.3010@woody.linux-foundation.org>
In-Reply-To
<9b3e2dc20801021237v4d5d236fn3d2643502b9bb78f@mail.gmail.com>
On Wed, 2 Jan 2008, Stephen Sinclair wrote:
Show 5 quoted lines
> 
> Is it possible to retroactively change the author and email of several
> commits?  Perhaps some sort of search-and-replace for the commit
> metadata?  Even for older commits, I'd like to change the email
> addresses to my current address.
See
	man git-filter-branch

and the "--env-filter" flag (and "--msg-filter" if you also want to change things like Sign-off's etc in the message text itself)

BUT! See also the big bold-face warning: using "filter-branch" will not change old commits, it will create a series of *new* commits that bear a striking resemblance to the old ones, but are not the same. So you'll have a totally new history.

That matters for things like
 - if you've already publicised the old history, you need to tell people 
   that they should fetch things anew
 - if you refer to the commit SHA1's elsewhere (like in commit messages 
   that revert previous commits), those SHA1's are still "valid", but they 
   refer to the *old* history, not the new history you created.

(I don't think git-filter-branch even exposes any easy way to remap the "revert commit xyz" messages in the message format. It's not technically hard to use a --msg-filter for it, but it seems a big bother).

		Linus
Previous: Jakub NarebskiNext: Stephen Sinclair
Message 3 of 9 in “Retroactively change email signature?”
  1. Stephen SinclairJan 2, 2008
  2. Jakub NarebskiJan 2, 2008
  3. Linus TorvaldsJan 2, 2008
  4. Stephen SinclairJan 2, 2008
  5. David BrownJan 3, 2008
  6. Sam VilainJan 3, 2008
  7. Linus TorvaldsJan 4, 2008
  8. Sam VilainJan 4, 2008
  9. Sam VilainJan 4, 2008

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.