git - E325 : ATTENTION Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"

标签 git github

我已经在一个团队中工作了将近一年。使用 github/git pull 和推送更改总是很容易:

git pull
git add .
git commit -a -m "my work desc"
git push

直到最近,它一直运行良好。现在无论如何,如果其他人已经推送,每当我尝试 pull 时,我都会收到此消息:

E325: ATTENTION
Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"
          owned by: X   dated: Wed Jan 23 16:01:06 2013
         file name: ~X/Sites/mysite/.git/COMMIT_EDITMSG
          modified: no
         user name: X   host name: X-2.local
        process ID: 77109
While opening file ".git/COMMIT_EDITMSG"
             dated: Thu Jan 24 16:22:48 2013
      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 .git/COMMIT_EDITMSG"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".git/.COMMIT_EDITMSG.swp"
    to avoid this message.

Swap file ".git/.COMMIT_EDITMSG.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

每次没有失败时都会发生这种情况。我最终可以通过插入一条消息、保存并重新提交来解决这个问题,但这很痛苦。知道为什么这种情况一直发生以及可以做什么吗?

谢谢

最佳答案

除非出于其他目的需要 .git/.COMMIT_EDITMSG.swp,否则您可以使用:

git rm .git/.COMMIT_EDITMSG.swp

从存储库中删除文件。

关于git - E325 : ATTENTION Found a swap file by the name ".git/.COMMIT_EDITMSG.swp",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14513349/

相关文章:

javascript - 垃圾邮件链接插入到我的 GitHub 页面网站

github - 在Github README.md上使用相对路径进行链接

git - 如何从没有子模块的分支 check out 带有子模块的分支

git - 如何注销一个Github账户并使用另一个账户?

github - GitHub 可以渲染 Zeppelin 笔记本吗?

git - 如何在 Git 中以交互方式将文件从一个分支 checkout 到另一个分支

git - 我可以从命令行向 github 添加问题吗?

git - 致命的 : Not a git repository:/Users/Mathias/Projects/punycode. js/.git/modules/vendor/docdown

git 所有标记为冲突的文件

node.js - 缺少 server.js/app.js 文件,未生成 web.config