git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: bill lam <cbill.lam@gmail.com>
Cc: Johannes Sixt <j.sixt@viscovery.net>, git <git@vger.kernel.org>
Subject: Re: combine git repo historically
Date: Sun, 11 Oct 2009 12:11:55 +0200	[thread overview]
Message-ID: <200910111211.56011.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20091011040659.GB9021@debian.b2j>

On Sunday 11 October 2009, bill lam wrote:
> On Sun, 11 Oct 2009, Christian Couder wrote:
> > $ 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.

  reply	other threads:[~2009-10-11 10:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09  1:22 combine git repo historically bill lam
2009-10-09  6:02 ` Johannes Sixt
2009-10-09  7:40   ` Christian Couder
2009-10-10 14:03   ` bill lam
2009-10-11  2:36     ` Christian Couder
2009-10-11  4:06       ` bill lam
2009-10-11 10:11         ` Christian Couder [this message]
2009-10-11  8:48       ` Jakub Narebski
2009-10-11 13:07         ` Johannes Sixt
2009-10-11 13:43           ` Christian Couder
2009-10-11 14:29             ` Jakub Narebski
2009-10-11  9:34       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910111211.56011.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=cbill.lam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).