致命:无法创建'refs / heads / master.lock':文件存在致命: - 推送提交时出现此错误 [英] fatal: unable to create 'refs/heads/master.lock': File exists fatal: - Getting this error while pushing the commits

查看:1570
本文介绍了致命:无法创建'refs / heads / master.lock':文件存在致命: - 推送提交时出现此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在推送提交时遇到以下错误:

I am getting the following error while pushing the commit

$ git push origin master
fatal: unable to create 'refs/heads/master.lock': File exists fatal:
The remote end hung up unexpectedly

我想从我的本地机器上移除锁定文件( refs / heads / master.lock )。但是这个文件不可用。我认为这个文件在git服务器中。

I thought of removing the lock file (refs/heads/master.lock) from my local machine. But this file is not available. I think this file is in git server.

这个问题的起源是什么?如果我从服务器上删除这个文件,它是否会解决问题,如果文件存在?

What is the origin of this issue? If I remove this file from the server, will it solve the issue if the file exists?

推荐答案

您需要删除现有 .lock 文件并尝试推送,

Linux



You need to remove existing .lock file and try to push,

rm -f .git/refs/heads/master.lock



Windows



Windows

del .git\refs\heads\master.lock

这篇关于致命:无法创建'refs / heads / master.lock':文件存在致命: - 推送提交时出现此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆