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

Re: copy selected history between repostories

From
Jeff King <peff@peff.net>
Date
Jul 19, 2008, 01:21 UTC
Message-ID
<20080719012107.GA14068@sigill.intra.peff.net>
In-Reply-To
<20080719010122.GA12047@mail.local.tull.net>
On Sat, Jul 19, 2008 at 11:01:22AM +1000, Nick Andrew wrote:
Show 11 quoted lines
> I couldn't figure out git-filter-branch, so I did the following,
> which worked for me:
> 
> First, export commits as patches in mbox format:
> 
> 	git log -p --first-parent --reverse --pretty=email $* > mbox
> [...]
> 
> Finally, import into new repo:
> 
> 	git-am mbox2

Note that this will lose any interesting history topology you had, like branching and merging (and it may have trouble applying all patches in that case, too). But if your history was a straight line, it should produce equivalent results.

-Peff
Previous: Johannes Schindelin
Message 5 of 5 in “copy selected history between repostories”
  1. luisgutzJul 18, 2008
  2. Avery PennarunJul 18, 2008
  3. Nick AndrewJul 19, 2008
  4. Johannes SchindelinJul 19, 2008
  5. Jeff KingJul 19, 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.