简体   繁体   English

SourceTree分段错误

[英]SourceTree Staging Error

After having used SourceTree with limited hiccups over the past 6 months or so, I am no longer able to commit any file to SourceTree. 在过去6个月左右使用SourceTree时遇到有限的打嗝,我无法再向SourceTree提交任何文件。 Whenever I try I am given this error message: 每当我尝试时,我都会收到以下错误消息:

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

If no other git process is currently running, this probably means a git process crashed in this repository earlier. 如果当前没有其他git进程正在运行,这可能意味着之前在此存储库中崩溃的git进程。 Make sure no other git process is running and remove the file manually to continue. 确保没有其他git进程正在运行,并手动删除该文件以继续。

I am aware of other questions like this one and have tried what I believe is about everything that people suggest fixes this problem. 我知道像这样的其他问题,并尝试了我认为的一切,人们建议修复这个问题。 Just to be safe, I will share with you guys what I have tried and HAS NOT worked. 为了安全起见,我将与你们分享我尝试过的并且没有工作的东西。

  1. The error seems rather explicit - delete the index.lock file. 错误似乎相当明确 - 删除index.lock文件。 The issue is that I do not have one. 问题是我没有。 I even created one and deleted it, both through the hidden .git folder and via the command prompt using: 我甚至创建了一个并删除它,通过隐藏的.git文件夹和命令提示符使用:

cd .git cd .git

del index.lock del index.lock

No file was found through the command line, until I created one and deleted it to no avail. 通过命令行找不到文件,直到我创建一个并删除它无济于事。 I tried other command line commands as well found from the linked post, none of them worked either. 我尝试了从链接帖子中找到的其他命令行命令,它们都没有工作。

  1. I ensured to the best of my abilities that no other programs are running git at the same time (no IDEs, no Xcode, no Tortoise, git-cola, etc). 我确保尽我所能,没有其他程序同时运行git(没有IDE,没有Xcode,没有Tortoise,git-cola等)。

  2. I closed SourceTree and re-opened it many times, as this fixed it for many people. 我关闭了SourceTree并多次重新打开它,因为这为许多人修复了它。

  3. I then set the entire folder to not read only, as it helped a different user. 然后我将整个文件夹设置为不可读,因为它帮助了不同的用户。

  4. I then went ahead and uninstalled SourceTree altogether - same exact issue. 然后我继续完全卸载了SourceTree - 同样的问题。

  5. I then restarted my machine, as that was also a fix for some. 然后我重新启动了我的机器,因为这也是一些修复。

  6. I read it could be that Visual Studio Source control was giving me an issue, so I followed these steps to no avail. 我读到可能是Visual Studio Source控件给了我一个问题,所以我按照这些步骤无济于事。

Go to: Tools > Options > Source Control 转到:工具>选项>源代码管理

Select Current source control plug-in as: None 选择Current source control插件为:None

  1. I then figured I would try a different project, and found out they are also broken (I have 4 different projects and they are all broken now and anytime I try to stage anything I get the same error). 然后我想我会尝试一个不同的项目,并发现它们也被打破了(我有4个不同的项目,现在它们都被打破了,每当我尝试播放任何东西时我都会得到同样的错误)。

  2. Now in complete chaos, I decided that I would fix this problem once and for all. 现在完全陷入混乱,我决定一劳永逸地解决这个问题。 I removed every single SourceTree project I had and obliterated my local projects. 我删除了我拥有的每个SourceTree项目并删除了我的本地项目。 I then went ahead and created a new git repo, imported it to BitBucket, and once again uninstalled and reinstalled SourceTree. 然后我继续创建一个新的git仓库,将其导入BitBucket,再次卸载并重新安装SourceTree。 This was the best I could do for a "fresh start". 这是我能为“新起点”做的最好的事情。 I then took my copied Unity project that I had uncommitted changes saved to, copied the Assets, Library, and Project settings folders in the empty local cloned project. 然后,我将我复制的Unity项目保存到保存的未提交的更改中,复制了空本地克隆项目中的Assets,Library和Project设置文件夹。 Set version control in Unity to Visible meta files and force text, and went to commit those files into my brand new emtpy repo, but still the error persists. 将Unity中的版本控制设置为可见元文件并强制文本,然后将这些文件提交到我的全新emtpy repo中,但仍然存在错误。

I know similar questions have been asked before, but I do believe I have tried everything I could and covered all of the most likely fixes. 我之前已经问过类似的问题,但我相信我已尽力而为,并涵盖了所有最可能的修复方法。

When I attempt to stage I get the error message with a red bar, and then only after manually hitting the close button I see a message that says "Unstaging Files" with a green bar and a "Completed successfully". 当我尝试暂存时,我会收到带有红色条的错误消息,然后只有在手动点击关闭按钮后,我才会看到一条消息,显示“Unstaging Files”,带有绿色条和“已成功完成”。 I watched the open .git folder and noticed that while SourceTree attempts to stage it does create the index.locked file briefly, but it always deletes it very shortly after creating it (we are talking within miliseconds it is gone). 我看了一下打开的.git文件夹并注意到,虽然SourceTree尝试暂存,但它确实创建了index.locked文件,但它在创建后很快就会删除它(我们正在毫秒内谈论它已经消失了)。

I am using SourceTree version 1.9.6.0, which I updated to on the 4th (2 days ago) and it worked just fine that night and early the next day. 我正在使用SourceTree版本1.9.6.0,我在4日(2天前)更新到了它,它在那天晚上和第二天早些时候工作得很好。 I made several script and scene changes in Unity the night of the 5th and it has not worked since then. 我在第五天晚上在Unity中进行了几次脚本和场景更改,从那时起它就没有用了。 I am on Windows 10, using Unity 5.0.4f3. 我在Windows 10上使用Unity 5.0.4f3。

Any help would be greatly appreciated. 任何帮助将不胜感激。

I had the exact problem after upgrading today - exact to the letter - and tried the exact same steps you did. 今天升级后我遇到了确切的问题 - 确切地说是信件 - 并尝试了与您完全相同的步骤。 Nothing worked. 没有任何效果。 So I found older versions of Source Tree here: 所以我在这里找到了旧版本的Source Tree:

https://www.sourcetreeapp.com/update/windowsupdates.txt https://www.sourcetreeapp.com/update/windowsupdates.txt

I went back to 1.8.3 and it's working great now. 我回到了1.8.3,现在工作得很好。

https://downloads.atlassian.com/software/sourcetree/windows/SourceTreeSetup_1.8.3.exe https://downloads.atlassian.com/software/sourcetree/windows/SourceTreeSetup_1.8.3.exe

1.9.5 may work, but I felt it safer to go back to 1.8.x 1.9.5可能有效,但我觉得回到1.8.x会更安全

FWIW, I have the same issue as the original poster. FWIW,我和原版海报有同样的问题。 I also recently upgraded to v1.9.6.0. 我最近也升级到v1.9.6.0。 I verified that the index.lock file is NOT present and CAN be created, but did not try the other fixes DPrate lists. 我验证了index.lock文件不存在并且可以创建,但没有尝试其他修复DPrate列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM