[tpm] [OT] Git repo combination

Carlo Costantini fifteen3 at gmail.com
Thu Jan 17 10:49:00 PST 2013


Hi Antonio,

I am going to call your remote repo 'RepoB' and your local 'RepoA'.

Is RepoB empty with no commits?

If it is not empty then yes you will need to use git subtree.
git subtree is for specifically combining two histories that do not
share a common commit.

If it is empty then you do not need to use git subtree.

You only need to add a remote repo to RepoA that points at RepoB and
'git push' your changes there.
The reason this will work is that RepoB has no conflicting history.

Sorry if this email was not required but your use of terms made me
question exactly what you need to do.

Hope I helped.

Carlo

>
> Message: 1
> Date: Thu, 17 Jan 2013 11:18:02 -0500
> From: Antonio Sun <antoniosun at lavabit.com>
> To: TPM Mongers <tpm at to.pm.org>
> Subject: [tpm] [OT] Git repo combination
> Message-ID:
>         <CAKczvCb9QyW=FW9rcPsmB7-Egz17-4nP8N8u_1PSOiaEKm8HPg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Perl Mongers,
>
> An off-topic question on Git -- how to put my locally managed Git repo
> under a sub-folder of another remote Git repo?
>
> My locally managed Git repo was created totally locally, without any remote
> repo. Now I hope everything, including the histories, can show up under a
> sub-folder of another remote Git repo.
>
> Please help.
>
> Thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130117/54f31942/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 17 Jan 2013 11:22:14 -0500
> From: Olaf Alders <olaf.alders at gmail.com>
> To: Antonio Sun <antoniosun at lavabit.com>
> Cc: TPM Mongers <tpm at to.pm.org>
> Subject: Re: [tpm] [OT] Git repo combination
> Message-ID: <604D1010-8EB3-4221-A033-93793F230A9A at gmail.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> On 2013-01-17, at 11:18 AM, Antonio Sun wrote:
>
>> Hi Perl Mongers,
>>
>> An off-topic question on Git -- how to put my locally managed Git repo under a sub-folder of another remote Git repo?
>>
>> My locally managed Git repo was created totally locally, without any remote repo. Now I hope everything, including the histories, can show up under a sub-folder of another remote Git repo.
>
>
> Hi Antonio,
>
> I think you want "git submodule".
>
> http://git-scm.com/book/en/Git-Tools-Submodules
>
> Best,
>
> Olaf
> --
> Olaf Alders
> olaf.alders at gmail.com
>
> http://www.wundercounter.com
> http://twitter.com/wundercounter
>
> 866 503 2204 (Toll free - North America)
> 416 944 8306 (direct)
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 17 Jan 2013 12:12:27 -0500
> From: Antonio Sun <antoniosun at lavabit.com>
> To: Olaf Alders <olaf.alders at gmail.com>
> Cc: TPM Mongers <tpm at to.pm.org>
> Subject: Re: [tpm] [OT] Git repo combination
> Message-ID:
>         <CAKczvCbsA1ucezz_xDz18QT+FYybg+rTXC39zB6BL=OCkqN02Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Thu, Jan 17, 2013 at 11:22 AM, Olaf Alders <olaf.alders at gmail.com> wrote:
>
>>
>> > An off-topic question on Git -- how to put my locally managed Git repo
>> under a sub-folder of another remote Git repo?
>> >
>> > My locally managed Git repo was created totally locally, without any
>> remote repo. Now I hope everything, including the histories, can show up
>> under a sub-folder of another remote Git repo.
>>
>>
>> Hi Antonio,
>>
>> I think you want "git submodule".
>>
>> http://git-scm.com/book/en/Git-Tools-Submodules
>>
>
> Thanks Olaf,
>
> That's not quite what I was looking for. For git submodule, "you want to be
> able to treat the two projects as *separate *yet still be able to use one
> from within the other. . .  Submodules allow you to keep a Git repository
> as a subdirectory of another Git repository. This lets you clone another
> repository into your project and keep your commits separate."
>
> I wasn't able to find a remote repo for my local repo until recently, now I
> just want to give my local repo a remote repo, but should be under a sub
> folder. Afterward, there would be only one *combined *repo. Would that be
> possible?
>
> Thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130117/f0eb7f63/attachment-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 17 Jan 2013 12:24:33 -0500
> From: Matthew Phillips <mattp at cpan.org>
> To: Antonio Sun <antoniosun at lavabit.com>
> Cc: TPM Mongers <tpm at to.pm.org>
> Subject: Re: [tpm] [OT] Git repo combination
> Message-ID:
>         <CAFWy7AYj74u5N+cO75HWLEqSKUHqRdHcD3yTLQboW2-bOwgy8A at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Antonio,
> You would want to use git subtree for this use case:
> http://git-scm.com/book/ch6-7.html  (Antonio, sorry for the double send.
> meant to reply-all).
>
> Cheers,
> Matt
>
> On Thu, Jan 17, 2013 at 12:12 PM, Antonio Sun <antoniosun at lavabit.com>wrote:
>
>>
>>
>>
>> On Thu, Jan 17, 2013 at 11:22 AM, Olaf Alders <olaf.alders at gmail.com>wrote:
>>
>>>
>>> > An off-topic question on Git -- how to put my locally managed Git repo
>>> under a sub-folder of another remote Git repo?
>>> >
>>> > My locally managed Git repo was created totally locally, without any
>>> remote repo. Now I hope everything, including the histories, can show up
>>> under a sub-folder of another remote Git repo.
>>>
>>>
>>> Hi Antonio,
>>>
>>> I think you want "git submodule".
>>>
>>> http://git-scm.com/book/en/Git-Tools-Submodules
>>>
>>
>> Thanks Olaf,
>>
>> That's not quite what I was looking for. For git submodule, "you want to
>> be able to treat the two projects as *separate *yet still be able to use
>> one from within the other. . .  Submodules allow you to keep a Git
>> repository as a subdirectory of another Git repository. This lets you clone
>> another repository into your project and keep your commits separate."
>>
>> I wasn't able to find a remote repo for my local repo until recently, now
>> I just want to give my local repo a remote repo, but should be under a sub
>> folder. Afterward, there would be only one *combined *repo. Would that be
>> possible?
>>
>> Thanks
>>
>>
>> _______________________________________________
>> toronto-pm mailing list
>> toronto-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/toronto-pm
>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130117/32ab0bc8/attachment.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
>
> ------------------------------
>
> End of toronto-pm Digest, Vol 70, Issue 8
> *****************************************


More information about the toronto-pm mailing list