16

Git operation failed because there are uncommitted changes. Commit or undo your changes before retrying. See the Output window for details.

However there are no uncommitted changes. One file that was added is restored from the stash, but that's it - the rest of them are stuck in limbo.

How can I get the rest of my files from the stash? (Short of opening them one by one and copypastaing them into my project...)

ekolis
  • 6,270
  • 12
  • 50
  • 101
  • What Output Window says? – Pavel Anikhouski Aug 06 '19 at 13:46
  • Opening repositories: C:\Users\edkol\source\repos\PlatformV2 Undoing edit: C:\Users\edkol\source\repos\PlatformV2\Src\Web\Web.config – ekolis Aug 06 '19 at 13:48
  • I don't think the output window is displaying anything from this particular operation... That text I just pasted is from a previous operation where I undid a change to web.config – ekolis Aug 06 '19 at 13:49
  • 2
    When you say there are no uncommitted changes, does `git status` actually report that your sandbox is clean? Can you edit your question and add the output of `git status`? (Run this command on the command line, please, not in VS2019.) – joanis Aug 06 '19 at 18:44
  • Oh well, I already opened all the modified files and copypastad the code into my project... – ekolis Aug 08 '19 at 15:12

3 Answers3

44

Running git status from my SourceTree terminal cleared up the error in Visual Studio. Even though the output of the command didn't show anything of interest:

$ git status
On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean

...but after doing that, Visual Studio let me apply the stash.

Scott Fletcher
  • 1,477
  • 2
  • 16
  • 20
1

My problem was only solved after I have made a commit. I did a irrelevant change to a file and commited. After that my git stash apply worked fine. Hours struggling and just one commit solved the problem. I hope you have the same luck.

ASPaiva
  • 143
  • 9
1

In my case, I had added a file that was also added in the stash. The files may have conflicted when applying the stash.

NathanX
  • 135
  • 11