git遇到过的错误

时间:2021-01-17 20:08:28

用git也是走了很多弯路。
比如:
这种错误
1.

$ git commit -a
fatal: Unable to create 'E:/****/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

解决方法:
使用了$ rm -f ./.git/index.lock

然后我估计是点击了编辑,就出现了这个鬼

<****.github.io/.git/COMMIT_EDITMSG[+][RO] [unix] (18:21 22/07/2016)1,0-1 All

输入:wq!(千万要记住!要加上去,万恶的电脑,少个符号都识别不了,这就是为什么我喜欢人脑)
然后就正常了
还有这种错误:
2.
git遇到过的错误

出现这个问题是因为,没有在github账号添加SSH key,
为了方便,我用了HTTPS协议