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

Merge selected files or folders

From
RKRichard Kerry <richard.kerry@eviden.com>
Date
Mar 21, 2024, 16:50 UTC
Message-ID
<PA4PR07MB7406FAC1F8C00E29979FCFF59E322@PA4PR07MB7406.eurprd07.prod.outlook.com>
I'd like to merge only certain files, or folders, from another branch.  What command or options should I be looking at to get this done?

What keywords should I be looking at?  When I ask Google I seem to find various answers which then get analysed as "actually don't do it like this, because it doesn't actually do a merge" or other unsatisfactory results. My colleague is mostly working on "master" and I am mostly working on a branch.  In most cases my branch should fast-forward to the head of master, so I'd have thought that behind the scenes it would just need to re-point the commit identifier, so there ought to be a straightforward implementation of this.

I know git expects to merge a whole branch throughout the repository, but this seems like something I can't be the only person ever to want, so I assume there is a "proper" way of doing it.  Or do I merge all then clear everything I don't want, which seems tedious.

Regards, Richard.

	
Next: Junio C Hamano
Message 1 of 7 in “Merge selected files or folders”
  1. Richard KerryMar 21, 2024
  2. Junio C HamanoMar 21, 2024
  3. Sergey OrganovMar 22, 2024
  4. Konstantin KhomoutovMar 22, 2024
  5. Dragan SimicMar 22, 2024
  6. stefan.naewe@atlas-elektronik.comMar 22, 2024
  7. Junio C HamanoMar 22, 2024

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.