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

Re: how to use git merge -s subtree?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jan 6, 2008, 03:45 UTC
Message-ID
<20080106034533.GE29972@genesis.frugalware.org>
In-Reply-To
<BAYC1-PASMTP12374B54BA370A1E1C6E78AE4E0@CEZ.ICE>
On Sat, Jan 05, 2008 at 08:17:40PM -0500, Sean <seanlkml@sympatico.ca> wrote:
Show 10 quoted lines
> Here's another way that is perhaps a little cleaner:
> 
> $ git remote add -f B /path/to/B
> $ git merge -s ours --no-commit B/master
> $ git read-tree --prefix=sub/ -u B/master 
> $ git commit -m "subtree merged B"
> 
> The first line creates and fetches the remote.  The second line initiates a merge, but
> stops before committing it.  The third line reads B/master into the subdirectory "sub",
> at which point all that remains is committing the completed merge.

great, thanks. that's more simple than mine, and this is necessary for the first commit only. the rest (i hope i'm right) can be done using just by

$ git fetch $ git merge -s subtree B/master

do you mind if i send a patch to add this to Documentation/howto? i don't think it's trivial :)

thanks,
- VMiklos
Previous: Junio C HamanoNext: David Soria Parra
Message 11 of 12 in “how to use git merge -s subtree?”
  1. Miklos VajnaJan 5, 2008
  2. SeanJan 6, 2008
  3. David Soria ParraJan 6, 2008
  4. SeanJan 6, 2008
  5. David Soria ParraJan 6, 2008
  6. Junio C HamanoJan 6, 2008
  7. SeanJan 6, 2008
  8. Junio C HamanoJan 7, 2008
  9. SeanJan 8, 2008
  10. Junio C HamanoJan 8, 2008
  11. Miklos VajnaJan 6, 2008
  12. David Soria ParraJan 6, 2008

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.