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

Re: git checkout effect on ls-files --others, how to merge partially?

From
Bbisani <bisani>
Date
Feb 6, 2009, 16:37 UTC
Message-ID
<loom.20090206T163626-457@post.gmane.org>
In-Reply-To
<slrngooent.om3.sitaramc@sitaramc.homelinux.net>
Sitaram Chamarty <sitaramc <at> gmail.com> writes:
Show 10 quoted lines
> 
> On 2009-02-06, Bisani, Alok <alok.bisani <at> credit-suisse.com> wrote:
>
> > 	Is there a way to pull in changes from a branch but only limited
> > to a file/files? I ended up doing a manual restore using git-cat-file
> ><branch>@{0}:/file. And checked in.
> 
> git checkout branch -- filename
> 
> 

This is exactly what I was looking for, thank you! I wonder why it is the checkout command which does this, rather than the pull/merge. What is the reason that we cannot pull/merge a specific file from a branch?

Previous: Sitaram ChamartyNext: Sitaram Chamarty
Message 3 of 4 in “git checkout effect on ls-files --others, how to merge partially?”
  1. Bisani, AlokFeb 6, 2009
  2. Sitaram ChamartyFeb 6, 2009
  3. bisaniFeb 6, 2009
  4. Sitaram ChamartyFeb 7, 2009

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.