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

Re: Git Stash stages files if there is a conflict

From
EREric Raible <raible@nextest.com>
Date
Oct 18, 2010, 17:18 UTC
Message-ID
<4CBC8161.3080507@nextest.com>
In-Reply-To
<loom.20101015T220924-952@post.gmane.org>
On 11:59 AM, Pretty Boy Floyd wrote:
Show 5 quoted lines
> Hello!
> 
> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,
> all of my stash changes get staged. Is this the correct behaviour? I found it a
> little surprising.
My tests indicate that the same thing happens as with any conflicted merge.
Namely: non-conflicting changes get staged, and conflicting changes are left
only in the working directory (with conflict markers added as appropriate).

See http://progit.org/book/ch3-2.html#basic_merging, especially the part on conflicts.

> Another question: if I have stashed 10 files, and there is a conflict in one of
> them, will stash apply abort when it has a conflict, or will it apply all
> non-conflicted files.

Same as above. In both cases the stash is unaffected, which allows you to reset and try again.

Show 8 quoted lines
> Finally, if I do the following:
> 
> git stash
> git pull
> git stash apply
> 
> and another developer has removed a file that I have stashed, then I am unable
> to apply the stash  on this file. How can I retrieve my changes from the stash?

One nice (relatively new feature) is "git stash branch", which makes a new branch from an existing stash.

HTH - Eric
Previous: Tor ArntsenNext: Aaron Boxer
Message 3 of 4 in “Git Stash stages files if there is a conflict”
  1. Pretty Boy FloydOct 15, 2010
  2. Tor ArntsenOct 18, 2010
  3. Eric RaibleOct 18, 2010
  4. Aaron BoxerOct 18, 2010

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.