I\'m using git, and made a small commit followed by a large one. I decided to use git rebase
to squash the two commits together before pushing them. (I\'ve ne
Same issue on Windows 10 64 Bit, running Git Bash version 2.9.0.windows1 Using Atom as my editor.
This worked for me: I added the Git software folder (for me, this was C:\Program Files\Git) to the exclusions for Windows Defender.
After the exclusion was added, git checkout 'file'
worked fine.
Just close your IDE (VISUAL STUDIO/ATOM etc). It might work
This error can also be caused by the fact that files are still "locked" because of prior git actions. It has to do with how the Windows filesystem layer works. I once read a nice explanation on this, but I can't remember where.
In that case however, since it is basically a race condition, all you have to do is continue your interrupted rebase process. Unfortunately this happens to me all the time, so I wrote this little dangerous helper to keep my rebases going:
#!/bin/sh
set -e
git checkout .
git clean -df
git rebase --continue
If you want to be extra sure, you can use git rebase --edit-todo
to check if the next commit to be applied is really the one that failed to be applied before. Use git clean -dn
to make sure you do not delete any important files.
Try closing any programs that have the folder open, such as editors, explorer windows, command prompts, and FTP programs. This always fixes the issue for me on Windows.
If you're running webpack shut it down. Shut down your IDE as well. Should work fine after doing those things.
I've just had this problem. The thing is - if you had opened file, that was removed\replaced after rebase (you had a branch which doesn't have a this file anymore), the git-system corrupts. So i closed all opened files and then tryied to checkout on some other branch