【问题标题】:How to commit a Git file locally?如何在本地提交 Git 文件?
【发布时间】:2017-03-07 15:09:43
【问题描述】:

我想为我的示例项目将文件提交到本地 Git 存储库

尝试在本地提交文件失败

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.

【问题讨论】:

    标签: git svn github commit git-commit


    【解决方案1】:

    按照以下步骤操作:

    • 关闭所有 Git 终端或任何其他正在访问该存储库文件的编辑器

    • 转到此路径: C:/Users/Divyanshu/Desktop/dktop/focus/Udacity/Git-hub/version-control/repositories/asteroids/.git/refs/heads/master.lock

    • 删除名为master.lock的文件

    • 以管理员模式再次运行 Git 终端

    那么你应该再次尝试提交!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-26
      • 2011-06-18
      • 1970-01-01
      • 2015-06-03
      • 2012-10-27
      • 2014-10-04
      • 2011-04-22
      • 2020-05-15
      相关资源
      最近更新 更多