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

how to use git merge -s subtree?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jan 5, 2008, 23:00 UTC
Message-ID
<20080105230004.GY29972@genesis.frugalware.org>
hi,

i recently noticed that the subtree merge strategy is missing from merge-strategies.txt an i tried to first figure out how it works. i got it to work, but i'm not 100% sure about i'm using it the way i'm supposed to.

here is what i do:
1) git remote add B /path/to/B.git
2) git fetch
3) mkdir B
4) touch B/.gitignore
5) git add B/.gitignore
6) git commit -m "add empty B directory"
7) git merge -s subtree B/master

and yes, it works pretty well, but is this the right way? or is it possible to somehow avoid steps 3..6?

thanks,
- VMiklos
Next: Sean
Message 1 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.