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

Re: combine git repo historically

From: Christian Couder <hidden>
Date: 2016-06-15 22:47:30

On Sunday 11 October 2009, bill lam wrote:
On Sun, 11 Oct 2009, Christian Couder wrote:
quoted
$ git checkout -b repo1-branch1 remote/repo1/branch1
$ git checkout N -- .
...
If everything is ok then you can use:

$ git replace N HEAD
Thanks for detail instruction, I tested it ok except that when trying
to checkout it reported an error

  $ git checkout -b repo1-branch1 remote/oldjproject/master
  fatal: git checkout: updating paths is incompatible with switching
branches. Did you intend to checkout 'remote/oldjproject/master' which
can not be resolved as commit?

but it ran ok by omitting that 'remote/'
$ git checkout -b repo1-branch1 oldjproject/master

Does it need to purge the file system tree before
  git checkout N -- .

so that there will be no artifact leaved by M?
Yeah, perhaps, I forgot that there could be some files added and other files 
removed between M and N.

If you remove everything (except the .git directory of course), then doing:

$ git checkout N -- .
$ git add .
$ export GIT_AUTHOR_NAME=<author name of commit N>
$ export GIT_AUTHOR_EMAIL=<author email of commit N>
$ export GIT_AUTHOR_DATE=<date of commit N>
$ git commit

should do the trick if I am not missing something which may very well be the 
case.

So perhaps it is easier to use Jakub's suggestion instead.
I found that it is necessary to do a
   git reset --hard (original HEAD)

to complete the story. Is it correct?
Yes, you should go back to your orginal branch at the end.

Regards,
Christian.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help