4

I am using TortoiseGit to work with a repository with a remote origin. I frequently have to stop in the middle of one change to work on another, so I use the stash feature to cordon off development I'm putting on hold, make more immediate changes, commit those, push, and then return to my stash.

Over time, this resulted in several stashed changes, all of which I was attempting to pop off at once.

The first couple of stash pops worked fine. Did a stash pop, committed, and repeated. However, one of the last ones resulted in the error message "Stash POP Fail!!!" (OMG! Three exclamation points!!!) The text below the error indicated one of the files I was attempting to pop had a merge conflict.

I did what I do when I get a conflict after a pull: I made edits to the conflicting file to fix the issues, told git that I had resolved the conflict, and finally committed the change.

Doing another stash pop, however, resulted in the same error, and attempting to resolve the differences showed that git was attempting to pull the same changes out of the stash as before. When I resolved the conflict a second time and attempted to commit, git informed me nothing had changed, and so there was nothing to commit.

Ultimately, to get past this issue (and get to the further-down stashes), I located this somewhat similar problem on SO and took the advice all the way at the bottom of the accepted answer. I opened up a git bash prompt and did a git stash drop to remove the stash that was causing the issue.

My questions are:

  1. Is this the best way to resolve the problem, or is there a more intuitive fashion -- ideally one that doesn't make me worry I'm about to throw away stashed changes?
  2. If this is the best way, is there any way to do a stash drop in TortoiseGit? I appreciate having GUI tools showing me what differences I'm merging/discarding, and so try to avoid reverting to the command line with git.
Community
  • 1
  • 1
Conspicuous Compiler
  • 6,403
  • 1
  • 40
  • 52

1 Answers1

6

Dropping a stash from tortoise

  • You can drop a stash in tortoise with "shift"->"right click"->"stash list" and then "right click"->"delete"

Checking the stash before you drop it

If you are worried about dropping a stash with changes you want to keep, you can diff it against your current working directory with:

  • From tortoise: shift->"right click"->"stash list" and "Compare with working copy"

  • From command line: git stash show -p

Community
  • 1
  • 1
Andy
  • 44,610
  • 13
  • 70
  • 69
  • Excellent! I didn't even know there was Shift+Right_Click feature in Tortoise. Thanks, Andy! – Conspicuous Compiler Feb 02 '12 at 21:27
  • What does the "shift" do? Normal right clicking on Win7 with latest tortoise (and from what I recall with previous ones as well for quite some versions back) has the same functionality (from stash point of view at least) – ciuly Dec 09 '16 at 18:02