git 添加的时候为什么出现这个问题,在线等

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 ear

直接将.git目录下的index.lock文件删掉

E325: ATTENTION
Found a swap file by the name "~/learngit/.git/.COMMIT_EDITMSG.swp"
owned by: john dated: Tue Oct 25 19:06:23 2016
file name: ~john/learngit/.git/COMMIT_EDITMSG
modified: YES
user name: john host name: john-PC
process ID: 5396
While opening file "/c/Users/john/learngit/.git/COMMIT_EDITMSG"
dated: Tue Oct 25 19:33:57 2016
NEWER than swap file!

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /c/Users/john/learngit/.git/C
OMMIT_EDITMSG"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/c/Users/john/learngit/.git/.
COMMIT_EDITMSG.swp"
to avoid this message.

Swap file "~/learngit/.git/.COMMIT_EDITMSG.swp" already exists!
-- More --
现在我修改我的文件,再次提交就变成这样了

找到.git/.COMMIT_EDITMSG.swp文件删除即可,这个文件是异常中断生成的隐藏交换文件