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

Re: 2.43+ git checkout --theirs on stash error - no alternative?

From
DDDevste Devste <devstemail@gmail.com>
Date
Nov 4, 2024, 10:09 UTC
Message-ID
<CANM0SV3vNBwoNw08AevHE-3cOjUTG4AGVJdpwfKCr=CX5DSW8w@mail.gmail.com>
In-Reply-To
<Zx7O3VsZX2B9d9qN@nand.local>

"--theirs" was necessary since I want the file exactly as it is in the stash - any conflicts from applying the file from stash should be automatically resolved using the hunk from the stash

On Mon, 28 Oct 2024 at 00:38, Taylor Blau <me@ttaylorr.com> wrote:
Show 16 quoted lines
>
> On Sun, Oct 27, 2024 at 11:31:05PM +0100, Devste Devste wrote:
> > Turns out the previous behavior can be achieved with
> > git restore --source='stash@{0}' -- "some-file.txt"
>
> Hmm. What you wrote above here makes sense, but I agree with the
> original change from Junio (CC'd) that using `--theirs` does not make
> sense when the source is a tree-ish and not the index directly.
>
> This is different, though, since here you are just trying to check out
> the contents of some-file.txt at stash@{0}, without `--theirs`. What did
> you mean in the previous example, and why was `--theirs` necessary in
> the call there?
>
> Thanks,
> Taylor
Previous: Taylor BlauNext: Junio C Hamano
Message 4 of 6 in “2.43+ git checkout --theirs on stash error - no alternative?”
  1. Devste DevsteOct 27, 2024
  2. Devste DevsteOct 27, 2024
  3. Taylor BlauOct 27, 2024
  4. Devste DevsteNov 4, 2024
  5. Junio C HamanoNov 4, 2024
  6. Devste DevsteNov 6, 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.