问题现象:git add 或者 git commit -m "first upload"
错误提示:
fatal: Unable to create '/path/my_proj/.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
原因分析:一般是同一个用户在不同的终端,同时登录导致某个终端对index文件进行加锁。
解决方法:rm -rf /path/my_proj/.git/index.lock 然后重新提交即可。