Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 25
    By default git stash will not stash files for which there are no history. So if you have files which you have not yet added but which would be overwritten or "created" by the merge, then the merge will still block. In that situation, you can use git stash -u to stash uncommitted files too. Or you can just delete them! Commented Mar 13, 2014 at 16:10
  • 35
    running git clean -dfx was a terrible idea. Removed some .gitignored files I actually needed. Commented May 20, 2014 at 16:10
  • 11
    I have encountered a situation where a user, after doing git reset --hard, still had unmerged changes! Commented May 11, 2015 at 11:45
  • 2
    Just a note. I was having trouble with .gitignore not being in-sync with the origin. I had been using git update-index --assume-unchanged C:\...\.gitignore I had to change it to track changes again so I could use git stash as in: git update-index --no-assume-unchanged C:\...\.gitignore Then the above worked great! Commented Jul 23, 2015 at 15:04
  • 5
    Discard local changes for a specific file using git checkout filename awesome point Commented Apr 18, 2018 at 11:14