Thread (11 messages) flat view 11 messages, 5 authors, 2016-06-15

Re: combine git repo historically

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:29

bill lam schrieb:
I have two git repos, no branches.

repo 1.
  emptyrootcommit -- A ... M 

repo 2.
  emptyrootcommit -- N ... Z

N was evolved from M but the time gap is large, how can I combine them
into one repo

emptyrootcommit -- A ... M -- N ... Z

so that snapshots N .. Z will not be changed.
$ echo $(git rev-parse N) $(git rev-parse M) >> .git/info/grafts
$ git filter-branch --tag-name-filter cat -- --all --not M

i.e. you graft the older history right before the younger history, then
you use git filter-branch to rewrite the parentship of the younger commits.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help