我想在本地为我的示例项目提交一个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.
答案 0 :(得分:2)
请按照以下步骤操作:
关闭所有Git终端或正在访问该存储库文件的任何其他编辑器
转到此路径:
C:/Users/Divyanshu/Desktop/dktop/focus/Udacity/Git-hub/version-control/repositories/asteroids/.git/refs/heads/master.lock
删除名为master.lock
以管理员模式再次运行Git终端
然后你应该再次尝试提交!