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

Re: import files w/ history

From
Jeff King <peff@peff.net>
Date
Mar 3, 2009, 13:00 UTC
Message-ID
<20090303130046.GA7867@coredump.intra.peff.net>
In-Reply-To
<slrngqqa4l.1t4t.csaba-ml@beastie.creo.hu>
On Tue, Mar 03, 2009 at 12:54:54PM +0000, Csaba Henk wrote:
> How could I import some files from an unrelated git repo with history?

Just "git pull" from the other repo, which will include all of its history. If you want to pretend that the other history contains just a subset of the true history, use "git filter-branch" to rewrite it first.

Show 10 quoted lines
> And if I'd like to use different paths? Eg:
> 
> Say the other repo has these files:
> 
> lib/trees/rb_tree.{c,h}
> 
> and I want to import them into my repo as
> 
> include/rb_tree.h
> src/rb_tree.c

If you are rewriting the history, you can rename the files as you see fit. There is even an example of this in "git help filter-branch".

-Peff
Previous: Csaba HenkNext: Csaba Henk
Message 2 of 8 in “import files w/ history”
  1. Csaba HenkMar 3, 2009
  2. Jeff KingMar 3, 2009
  3. Csaba HenkMar 6, 2009
  4. Miklos VajnaMar 6, 2009
  5. Jeff KingMar 8, 2009
  6. Csaba HenkMar 9, 2009
  7. Jeff KingMar 10, 2009
  8. Csaba HenkMar 11, 2009

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.