首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在本地提交Git文件?

如何在本地提交Git文件?
EN

Stack Overflow用户
提问于 2017-03-07 15:09:43
回答 1查看 58关注 0票数 1

我想为我的示例项目在本地向Git存储库提交一个文件

在本地提交文件的尝试失败

代码语言:javascript
复制
Divyanshu (master +) asteroids $ git commit -m "Fire one bullet at a time"

fatal: cannot lock ref 'HEAD': Unable to create 'C:/Users/Divyanshu/Desktop/dktop/focus/
Udacity/Git-hub/version-control/repositories/asteroids/.git/refs/heads/master.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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-07 15:13:21

遵循以下步骤:

  • 关闭所有访问该存储库文件的Git终端或任何其他编辑器。
  • 转到这个路径:C:/Users/Divyanshu/Desktop/dktop/focus/Udacity/Git-hub/version-control/repositories/asteroids/.git/refs/heads/master.lock
  • 删除名为master.lock的文件
  • 在管理员模式下再次运行Git终端

那你就再来一次吧!

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42651753

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档