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

Re: Stash during incomplete merge

From
NKNeal Kreitzinger <nkreitzinger@gmail.com>
Date
Feb 28, 2012, 22:24 UTC
Message-ID
<4F4D5408.3060505@gmail.com>
In-Reply-To
<4F4D377B.2000206@gmail.com>
On 2/28/2012 2:22 PM, Neal Kreitzinger wrote:
Show 5 quoted lines
>
> You may also want to consider the --keep-index option on your "git
> stash save" if your "testing" workflow doesn't involve adds or
> commits before the git stash apply/pop.
>

the very limited case I had in mind (and probably incorrect assumption) about your "testing" workflow was:

hack merge-conflicts $ git add conflict-resolution (conflict-resolution is in worktree and index) hack conflict-resolution with extra stuff (original conflict-resolution is still in index) uh-oh, i got carried away and started doing extra stuff (evil merge) and forgot to finish testing just the conflict-resolutions (pure merge-commit) $ git stash --keep-index (conflict-resolution is still in index and now back in wokrtree) finish testing just the conflict-resolutions (merge-commit-to-be) (conflict resolutions worked (I knew they would)) $ git stash pop (original conflict resolution is still in index, but extra-stuff is back in worktree) $ git commit (commit the conflict-resolutions/merge-commit) $ git add foo $ git commit (new foo stuff committed after merge commit)

v/r, neal

Previous: Neal KreitzingerNext: Neal Kreitzinger
Message 3 of 4 in “Stash during incomplete merge”
  1. Phil HordFeb 26, 2012
  2. Neal KreitzingerFeb 28, 2012
  3. Neal KreitzingerFeb 28, 2012
  4. Neal KreitzingerFeb 29, 2012

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.