git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Copying files and keeping the history
@ 2009-06-11 13:20 JörgenHägg
  2009-06-11 18:29 ` Sverre Rabbelier
  0 siblings, 1 reply; 3+ messages in thread
From: JörgenHägg @ 2009-06-11 13:20 UTC (permalink / raw
  To: git


I have two completely different git repositories, A and B.

I want to move a file from repo A to B without losing the files history.
That is, I want the commit message and all other info from
each commit where the file was included to generate new
commits in repo B.
(Yes, I know git manages content, not files. :-)

In other words, export a bunch of commits, filtering out the
patches for the file and import these in another repo.

Sort of importing from cvs to git, only the source and destination
are both git repositories.

I tried tailor from git to git, but that was probably not what tailor
wanted to do. :-)

Is this somehow possible?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copying files and keeping the history
  2009-06-11 13:20 Copying files and keeping the history JörgenHägg
@ 2009-06-11 18:29 ` Sverre Rabbelier
  2009-06-12  3:44   ` Avery Pennarun
  0 siblings, 1 reply; 3+ messages in thread
From: Sverre Rabbelier @ 2009-06-11 18:29 UTC (permalink / raw
  To: JörgenHägg; +Cc: git

Heya,

On Thu, Jun 11, 2009 at 15:20, JörgenHägg<jorgen.hagg@axis.com> wrote:
> Is this somehow possible?

Try git filter-branch to get just the commits you want and nudge them
to contain what you want (do this in a seperate branch/copy of
repository A). When you're done, pull the branch into B and merge it.
Instant win?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copying files and keeping the history
  2009-06-11 18:29 ` Sverre Rabbelier
@ 2009-06-12  3:44   ` Avery Pennarun
  0 siblings, 0 replies; 3+ messages in thread
From: Avery Pennarun @ 2009-06-12  3:44 UTC (permalink / raw
  To: Sverre Rabbelier; +Cc: JörgenHägg, git

On Thu, Jun 11, 2009 at 2:29 PM, Sverre Rabbelier<srabbelier@gmail.com> wrote:
> On Thu, Jun 11, 2009 at 15:20, JörgenHägg<jorgen.hagg@axis.com> wrote:
>> Is this somehow possible?
>
> Try git filter-branch to get just the commits you want and nudge them
> to contain what you want (do this in a seperate branch/copy of
> repository A). When you're done, pull the branch into B and merge it.
> Instant win?

You could also consider 'git subtree'
(http://github.com/apenwarr/git-subtree) to merge the other tree
(including its history) in as a subdirectory.

Avery

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-12  3:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 13:20 Copying files and keeping the history JörgenHägg
2009-06-11 18:29 ` Sverre Rabbelier
2009-06-12  3:44   ` Avery Pennarun

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).