透明水晶 2023-03-22 09:06 采纳率: 96.8%
浏览 20
已结题

GIT还原文件报错-20230322-01

GIT还原文件报错


$ git reset --hard HEAD
fatal: Unable to create 'D:/01_project/02_XXXXX/XXXXX/XXXXX_XXXXX_XXXXX/.git/index.lock': File exists.

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 earlier:
remove the file manually to continue.
另一个 git 进程似乎正在此存储库中运行,例如
由“git commit”打开的编辑器。请确保所有流程
已终止,然后重试。如果仍然失败,则 git 进程
可能之前在此存储库中崩溃:
手动删除文件以继续。
$ git checkout drivers/soc/usb/usb.a
Unlink of file 'drivers/soc/usb/usb.a' failed. Should I try again? (y/n) y
Unlink of file 'drivers/soc/usb/usb.a' failed. Should I try again? (y/n) y
Unlink of file 'drivers/soc/usb/usb.a' failed. Should I try again? (y/n) y
Unlink of file 'drivers/soc/usb/usb.a' failed. Should I try again? (y/n) y
Unlink of file 'drivers/soc/usb/usb.a' failed. Should I try again? (y/n) n
error: unable to unlink old 'drivers/soc/usb/usb.a': Invalid argument
Updated 0 paths from the index
  • 写回答

2条回答 默认 最新

  • 光吃,不胖 2023-03-22 09:19
    关注

    这个问题主要是上次git命令出现异常,文件没释放,你可以手动删除index.lock文件,再执行命令

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 6月9日
  • 已采纳回答 6月1日
  • 修改了问题 3月22日
  • 修改了问题 3月22日
  • 展开全部

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)