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

3个回答

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文件删除即可,这个文件是异常中断生成的隐藏交换文件

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

sinat_35676582
sinat_35676582 但是下一次添加又会出现这样的问题
接近 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!