GIT: /.git/index.lock': File exists
fatal: Unable to create '/.git/index.lock': File exists
解决方法:
Try
rm -f ./.git/index.lock
In your repository directory.
===================================
Unlink of file failed
Unlink of file 'xxx/xxx/xxx.xx' failed. Should I try again? (y/n) y
That usually means a process is still using that specific file (still has an handle on it)
(on Windows, ProcessExplorer
is good at tracking that kind of process)
解决方法:关掉你的VS2008等IDE。
===================================
error: git checkout-index: unable to create file (Permission denied)
error: unable to create file xxx/xxx/release/emulator/bin/Loader.log (Permission denied)
fatal: Could not reset index file to revision 'c6e028341caa8d72ab407d69e63a6503e69d84ae'.
上面链接说的都是权限问题,但是不要被这个提示误导了。我的实际上是一个loader.exe在打开,关闭就好了。
$ git reset --hard xxx_gitTag(也就是git log下显示的commit后面跟的commitId)
HEAD is now at c6e0283 Merge MR-255 from branch 'somebody/xxx_project.git::master' into 'master'
解决方法:关掉某个运行的exe,它可能正在占用某个文件。