当我尝试将项目树移动到git repo时,我仍然收到此错误消息.
我用这个项目检查了我的目录的权限,这些是在777上设置的.在my_project我设置的目录中的终端:
git init
如果我试试
git add.
要么
git commit -m"首次上传"
所以我会得到错误
fatal: Unable to create '/path/my_proj/.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
Run Code Online (Sandbox Code Playgroud)
我也尝试创建一个新的repo并在那里提交它,但遗憾的是仍然是同样的错误信息......我已经有点绝望了,我试着找到整个下午的解决方案,但仍然没有成功...
请问有谁帮助我,问题的原因是什么?
百万次谢谢!
当我做'git commit'时,我得到以下内容:
fatal: Unable to create 'project_path/.git/index.lock': File exists.
但是,当我这样做时ls project_path/.git/index.lock,说该文件不存在.我应该怎么做?我也注意到project_path/.git由root拥有,不确定这是否与我遇到的问题有关.
git版本是1.7.5.4
编辑:似乎问题很可能是我运行的另一个进程,即向项目目录编写(我不知道).我重新启动了我的机器然后我没有任何问题.
你知道是否有办法阻止提交到本地git存储库?在我的构建环境中,我正在通过它运行一些git命令,如果用户在构建期间进行提交,它会中断.
我想在构建正在进行时锁定存储库,然后在构建完成时解锁.
谢谢!
git ×3