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

Re: How to rewrite author history

From
Andrew Arnott <andrewarnott@gmail.com>
Date
Mar 22, 2008, 19:06 UTC
Message-ID
<216e54900803221206l39d61bcw1c546b9812968ac0@mail.gmail.com>
In-Reply-To
<20080322165737.GB7611@coredump.intra.peff.net>

Thanks, Jeff. That was very helpful. I have published my repo online already, but only a couple people (if even that) have cloned it by now and I am prepared to email the list of interested parties letting them know. About this rebasing thing, is there a better way than for them to just wipe their repo and clone again? Would a simple git fetch and git rebase do the trick?

Thanks again, everyone.
On Sat, Mar 22, 2008 at 9:57 AM, Jeff King <peff@peff.net> wrote:
Show 39 quoted lines
> On Sat, Mar 22, 2008 at 06:11:12AM -0700, Andrew Arnott wrote:
>
>  > git-filter-branch --env-filter '
>  > [...]
>
> > And I did this for master, and my v1 and v0.1 branches.  I'm concerned
>  > though, that since I changed the names of all the objects by doing
>  > this, did I somehow make my branches incompatible with each other?
>  > Will there be any problems in the future sharing commits or merging
>  > across branches as a result?
>
>  There are two concerns, and I'm not sure which you have (I think number
>  1):
>
>   1. Your branches within the repository will not connect anymore. I
>      believe this is a non-issue with your filter, since the generated
>      commit IDs are deterministic. Certainly a toy case worked for me
>      with:
>
>        for i in master branch; do
>          git filter-branch --env-filter=... $i
>        done
>
>      You can also specify both to be done at the same time, which is
>      more efficient:
>
>        git filter-branch --env-filter=... master branch
>
>      You can check the graph structure with "gitk master branch" which
>      should show them connecting.
>
>   2. Your branches are now a different, rewritten history compared to
>      anyone who has cloned or fetched from you. This is unavoidable, and
>      the answer is either "don't use filter-branch" or "tell everyone to
>      rebase their work on the new history." So the best time to
>      filter-branch is right after import, but before you start work.
>
>  -Peff
>
-- 
Andrew Arnott
Previous: Jeff KingNext: Jeff King
Message 6 of 7 in “Re: How to rewrite author history”
  1. Andrew ArnottMar 21, 2008
  2. Dmitry PotapovMar 21, 2008
  3. Samuel TardieuMar 22, 2008
  4. Andrew ArnottMar 22, 2008
  5. Jeff KingMar 22, 2008
  6. Andrew ArnottMar 22, 2008
  7. Jeff KingMar 23, 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.