相关疑难解决方法(0)

Git - 致命:无法创建'/path/my_project/.git/index.lock':文件存在

当我尝试将项目树移动到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

755
推荐指数
17
解决办法
48万
查看次数

Git从index.lock重命名为索引失败

使用GitHub Windows客户端我进行了同步以将远程更改提取到本地计算机,但在完成同步之前,我的磁盘空间不足,同步失败.现在我似乎有一堆本地更改,实际上是从原点中提取的更改.我试着运行git pull但得到了:

C:\Users\Tom\SourceLog [master +4 ~26 -0 !]> git pull
Updating b3a86e1..5afd74f
error: Your local changes to the following files would be overwritten by merge:
        SourceLog.Interface/IChangedFile.cs
        SourceLog.Interface/ILogEntry.cs
        ...
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
        Lib/MSBuildExtensionPack/4.0.6.0/Ionic.Zip.dll
        Lib/MSBuildExtensionPack/4.0.6.0/MSBuild.ExtensionPack.dll
        ...
Aborting
Run Code Online (Sandbox Code Playgroud)

所以现在我想丢弃当地的变化,但我得到了:

C:\Users\Tom\SourceLog [master +4 ~26 -0 !]> git checkout -- .
Rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) …
Run Code Online (Sandbox Code Playgroud)

windows git github windows-7

35
推荐指数
5
解决办法
4万
查看次数

GIT:/.git/index.lock':文件存在

我和我的一个git repos有一个问题.我一直收到以下错误:

    fatal: Unable to create 'v:/path/to/files/.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)

我已经尝试过:rm -f ./.git/index.lock根据stackoverflow上的另一个线程但我每次都会收到此错误:rm:无法取消链接`./.git/index.lock':权限被拒绝

当我关闭aptana(我在终端中使用git)时,我无法删除文件.

任何想法如何解决这个问题?

另外需要注意的是,当我偶尔在其中进行提交时,这个git repo非常慢(它允许我每10次尝试一次)

谢谢

git

16
推荐指数
2
解决办法
4万
查看次数

SourceTree分段错误

在过去6个月左右使用SourceTree时遇到有限的打嗝,我无法再向SourceTree提交任何文件.每当我尝试时,我都会收到以下错误消息:

git -c diff.mnemonicprefix = false -c core.quotepath = false reset -q - Assets/... fatal:无法创建'E:/ Users /.../.git/index.lock':文件存在.

如果当前没有其他git进程正在运行,这可能意味着之前在此存储库中崩溃的git进程.确保没有其他git进程正在运行,并手动删除该文件以继续.

我知道像这样的其他问题,并尝试了我认为的一切,人们建议修复这个问题.为了安全起见,我将与你们分享我所尝试的并且没有工作的东西.

  1. 错误似乎相当明确 - 删除index.lock文件.问题是我没有.我甚至创建了一个并删除它,通过隐藏的.git文件夹和命令提示符使用:

cd .git

del index.lock

通过命令行找不到文件,直到我创建一个并删除它无济于事.我尝试了从链接帖子中找到的其他命令行命令,它们都没有工作.

  1. 我确保尽我所能,没有其他程序同时运行git(没有IDE,没有Xcode,没有Tortoise,git-cola等).

  2. 我关闭了SourceTree并多次重新打开它,因为这为许多人修复了它.

  3. 然后我将整个文件夹设置为不可读,因为它帮助了不同的用户.

  4. 然后我继续完全卸载了SourceTree - 同样的问题.

  5. 然后我重新启动了我的机器,因为这也是一些修复.

  6. 我读到可能是Visual Studio Source控件给了我一个问题,所以我按照这些步骤无济于事.

转到:工具>选项>源代码管理

选择Current source control插件为:None

  1. 然后我想我会尝试一个不同的项目,并发现它们也被打破了(我有4个不同的项目,现在它们都被打破了,每当我尝试播放任何东西时我都会得到同样的错误).

  2. 现在完全陷入混乱,我决定一劳永逸地解决这个问题.我删除了我拥有的每个SourceTree项目并删除了我的本地项目.然后我继续创建一个新的git仓库,将其导入BitBucket,再次卸载并重新安装SourceTree.这是我能为"新起点"做的最好的事情.然后,我将我复制的Unity项目保存到保存的未提交更改中,复制了空本地克隆项目中的Assets,Library和Project设置文件夹.将Unity中的版本控制设置为可见元文件并强制文本,然后将这些文件提交到我的全新emtpy repo中,但仍然存在错误.

我之前已经问过类似的问题,但我相信我已尽力而为,并涵盖了所有最可能的修复方法.

当我尝试暂存时,我会收到带有红色条的错误消息,然后只有在手动点击关闭按钮后,我才会看到一条消息,显示"Unstaging Files",带有绿色条和"已成功完成".我看了一下打开的.git文件夹并注意到,虽然SourceTree尝试暂存,但它确实创建了index.locked文件,但它在创建后很快就会删除它(我们正在毫秒内谈论它已经消失了).

我正在使用SourceTree版本1.9.6.0,我在4日(2天前)更新到了它,它在那天晚上和第二天早些时候工作得很好.我在第五天晚上在Unity中进行了几次脚本和场景更改,从那时起它就没有用了.我在Windows 10上使用Unity 5.0.4f3.

任何帮助将不胜感激.

git version-control bitbucket atlassian-sourcetree unity5

10
推荐指数
1
解决办法
944
查看次数

致命:无法创建'/.git/index.lock':文件存在

当我尝试重命名我的任何图像名称时Xcode Project,会出现以下错误.

fatal: Unable to create '/.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)

不知道出了什么问题.提前致谢.

xcode xcode4.5

7
推荐指数
1
解决办法
1万
查看次数

.git/index.lock 文件不断重新出现

当我尝试运行任何 git 命令时,我得到以下信息

$ git add .
 fatal: Unable to create 'J:/Project/geospatial/U5M_africa/.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)

我删除该文件没有任何错误:

$ rm -f .git/index.lock
Run Code Online (Sandbox Code Playgroud)

我也尝试在 Windows 中手动删除它。文件消失,但立即重新出现。如果我尝试任何 git 命令,我仍然会遇到同样的致命错误。

是什么导致该文件立即重新出现?我怎样才能永远摆脱它并继续我的生活?

git

5
推荐指数
1
解决办法
3706
查看次数

吉特 | 是什么原因导致 git 错误:'致命:无法创建'/index.lock':权限被拒绝'错误?

我有一个问题,即使有 Google 叔叔的帮助,我自己也无法回答。

当我尝试在我的一个项目中使用“ git checkout ”命令时,我收到如下错误:

'fatal: Unable to create *'some/directory/path/index.lock'*: Permission denied'
Run Code Online (Sandbox Code Playgroud)

我知道这个问题与 .git 目录内的权限有关。我想知道是什么行为导致了这种情况以及将来如何预防这种情况。

TL;DR是什么原因导致“致命:无法创建“/index.lock”:权限被拒绝”错误?

git permissions error-handling file-permissions magento

5
推荐指数
1
解决办法
1万
查看次数

git push ...致命:无法创建master.lock:文件存在

救命!当我尝试git push origin master现在做时,我得到:

fatal: Unable to create '/home/ubuntu/workspace/.git/refs/remotes/origin/master.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)

当然,我还发现了其他类似的问题(例如here),但是那里被高调回答的问题只是建议删除有问题的文件...但是该文件不存在!

我担心这是在我最近尝试使用以下方法清除一些空间之后发生的:

$ sudo git reflog expire --all --expire=now
$ sudo git gc --prune=now --aggressive
Run Code Online (Sandbox Code Playgroud)

那可能是原因吗?有修复建议吗?

git repository

3
推荐指数
1
解决办法
1620
查看次数

如果存在git index.lock,我可以安全地删除它,还是需要更多动作来验证完整性?

在过去的几周里,我得到了一条关于index.lock存在几次的消息.

删除该文件在git index.lock中作为解决方案提到 我尝试提交时存在文件,但无法删除该文件

是否正在删除该文件,或者是否需要执行其他操作(有没有办法验证完整性等等?).

这是在安装了git命令行工具,TortoiseGIT和SourceTree的Windows x64系统(完全修补)上.

windows git

2
推荐指数
1
解决办法
1876
查看次数

尝试推送时出现 Git 错误:放弃更改 - 无法解锁

我目前正在使用 git 存储库。无法将我的文件推送到远程存储库。

它显示 C:/somelocation/.git/index 的“放弃更改 - 无法解锁”。

没有其他细节可以找出问题所在。

在此输入图像描述

甚至尝试重置。

git重置

但给出以下错误。

期间发生内部错误:“重置为 refs/heads/develop”。执行重置命令期间捕获异常。{0}

git github

0
推荐指数
1
解决办法
2356
查看次数