git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How-to combine several separate git repos?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Dec 10, 2007, 07:52 UTC
Message-ID
<20071210075231.GA2984@steel.home>
In-Reply-To
<475C3E25.30704@saville.com>
Wink Saville, Sun, Dec 09, 2007 20:12:37 +0100:
Show 11 quoted lines
>> You can merge them, for example:
>>
>>     $ cd project1
>>     $ git merge project2/master
>>   
> Starting over (restoring the original from a tar backup)
> this didn't work I get:
>
> wink@ic2d1:$ cd StateMachine
> wink@ic2d1:$ git merge ../test2/master
> ../test2/master - not something we can merge
This is *not* what I suggested. It should be:
    $ git config ... (as suggested before)
    $ git fetch test2
    $ git merge test2/master

Here test2/master - is *NOT* a path. It is the name of the branch where the local repository stores reference to the commit corresponding to the master of remote repo (that is: the "master" branch of "test2", as seen from the repository where you do the merge).

> So the first suggestion works, but I don't want them as
> separate branches as I want to work on the simultaneously
> and they'll share common code.
Sound like the secode (merge) approach
> Another option I was thinking would work for me would be to use
> submodules. But I'm not sure submodules are ready for
> neophytes and maybe it doesn't do what I want?

They are ready for some (dunno if they'd like to be called neophytes). I just don't think you need them (keywords on your explanations being "share common code", understanding them as "the modules use the common code simultaneously").

Previous: Wink SavilleNext: Wink Saville
Message 12 of 13 in “How-to combine several separate git repos?”
  1. Wink SavilleDec 9, 2007
  2. Alex RiesenDec 9, 2007
  3. Wink SavilleDec 9, 2007
  4. Daniel BarkalowDec 9, 2007
  5. Wink SavilleDec 9, 2007
  6. Daniel BarkalowDec 10, 2007
  7. Wink SavilleDec 10, 2007
  8. Daniel BarkalowDec 10, 2007
  9. Wink SavilleDec 10, 2007
  10. Daniel BarkalowDec 10, 2007
  11. Wink SavilleDec 10, 2007
  12. Alex RiesenDec 10, 2007
  13. Wink SavilleDec 10, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.