Git Bash commit 出現 Aborting commit due to empty commit message

參考文章

https://blog.csdn.net/RobotYa...
https://stackoverflow.com/que...
https://stackoverflow.com/que...

錯誤復現

  • vim 項目中修改任意文件,正常 wq 保存
  • git commit -a 輸入 log 內容後,強制關閉 git bash
  • 再次打開 git bash,輸入git commit -a ,此時報錯
  • git bash 錯誤提示

錯誤緣由

  • 輸入 log 內容後,編輯器已經生成了 .swp 文件,而強制關閉會致使 .swp 沒有被正確處理
  • 未正確處理的swp

解決方式

  • cd .git
  • ls -al
  • rm .COMMIT_EDITMSG.swp
  • 從新 git commit -a 正常操做便可
相關文章
相關標籤/搜索