最新消息:VPS服务器又从fzhost.net换回Linode了,主题仍用朋友推荐的大前端D8

[已解决]git pull时出错:fatal Unable to create .git/index.lock File exists

Git crifan 38浏览 0评论

在执行了:

git stash

后,去:git pull

结果出错:

➜  SalesAppiOS git:(master) git pull
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 34 (delta 21), reused 0 (delta 0)
Unpacking objects: 100% (34/34), done.
From http://git.oschina.net/QorosSalesApp/SalesAppiOS
   77482fd..269468c  master     -> origin/master
Updating 77482fd..269468c
fatal: Unable to create ‘/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/.git/index.lock’: File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

如图:

git pull fatal: Unable to create .git/index.lock File exists

git fatal Unable to create .git/index.lock File exists

git致命错误:Unable to create ‘/path/my_project/.git/index.lock’: File exists._git_帮酷问答

Git 使用的一些命令以及Git commit 注释格式 – ConquerMobileApp – 博客园

git index.lock File exists when I try to commit, but cannot delete the file – Stack Overflow

Git – fatal: Unable to create ‘/path/my_project/.git/index.lock’: File exists. – Stack Overflow

关于Git无法提交 index.lock的解决办法 – ConquerMobileApp – 博客园

先去强制删除index.lock:

➜  SalesAppiOS git:(master) rm -f .git/index.lock

然后再去git pull就可以了:

➜  SalesAppiOS git:(master) git pull            
Updating 77482fd..269468c
Fast-forward
SalesApp.xcodeproj/project.pbxproj                    |  34 +++++++++++++–
SalesApp/AllocationCustomerViewController.swift       |  16 ++++—
SalesApp/CrifanChartDemo.swift                        |  99 ++++++++++++++++++++++++++++++++++++++++++++
SalesApp/CrifanFloatDemo.swift                        |  17 ++++++++
SalesApp/CrifanIntDemo.swift                          |  43 +++++++++++++++++++
SalesApp/CrifanLibDemo.swift                          | 170 +————————————————————————–
SalesApp/CrifanNSDateDemo.swift                       |  80 +++++++++++++++++++++++++++++++++++
SalesApp/CrifanThreadDemo.swift                       |  27 ++++++++++++
SalesApp/CrifanUIDeviceDemo.swift                     |  40 ++++++++++++++++++
SalesApp/CrifanViewControllerDemo.swift               |  69 +++++++++++++++++++++++++++++++
SalesApp/CustomerViewController.swift                 |  36 ++++++++++——
SalesApp/GlobalConstants.swift                        |   4 +-
SalesApp/Info.plist                                   |   2 +-
SalesApp/LoginRegisterViewController.swift            |   6 ++-
SalesApp/SearchAllocationCustomerViewController.swift |  13 ++++–
SalesApp/SearchCustomerViewController.swift           |  14 +++++–
SalesApp/ServerApi.swift                              |   2 +-
SalesApp/ToBeAllocationCustomerViewController.swift   |  18 ++++—-
18 files changed, 480 insertions(+), 210 deletions(-)
create mode 100644 SalesApp/CrifanChartDemo.swift
create mode 100644 SalesApp/CrifanFloatDemo.swift
create mode 100644 SalesApp/CrifanIntDemo.swift
create mode 100644 SalesApp/CrifanNSDateDemo.swift
create mode 100644 SalesApp/CrifanThreadDemo.swift
create mode 100644 SalesApp/CrifanUIDeviceDemo.swift
create mode 100644 SalesApp/CrifanViewControllerDemo.swift

[总结]

此处,不知道之前,什么原因,导致了git被lock锁死了

导致此处git pull从服务器更新失败。

解决办法是:

删除那个lock文件:

rm -f .git/index.lock

然后就可以继续(之前的git pull)操作了。

转载请注明:在路上 » [已解决]git pull时出错:fatal Unable to create .git/index.lock File exists

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
18 queries in 0.452 seconds, using 10.07MB memory