views:

47

answers:

1

I have two git repositories that are tangentially related. Namely, content of one was a predecessor of the other. I would like to somehow prepend the full history of depository A to the depository B, so that tip of A would be a parent of the very first changeset of depository B? Histories in both are pretty linear.

Is this possible?

+2  A: 

You could try using the graft file (.git/info/grafts) where you could overwrite the parenthood of a commit (like the first of projectB having for parent the latest of projectA)

See also "What are .git/info/grafts for?" and "How to prepend the past to a git repository?" for more on this manipulation.

VonC
Worked just fine for me, thanks VonC, didn't think it would be that simple.
SilentGhost
Then you can rewrite history using `git filter-branch` to make what graft brought permanent... but this rewrites history.
Jakub Narębski