Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

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.

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. 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:

cd .git

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).

  2. I closed SourceTree and re-opened it many times, as this fixed it for many people.

  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.

  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.

Go to: Tools > Options > Source Control

Select Current source control plug-in as: 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).

  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. I then went ahead and created a new git repo, imported it to BitBucket, and once again uninstalled and reinstalled 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. 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.

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". 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).

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. I made several script and scene changes in Unity the night of the 5th and it has not worked since then. I am on Windows 10, using Unity 5.0.4f3.

Any help would be greatly appreciated.

like image 901
DPrate Avatar asked Aug 06 '16 13:08

DPrate


2 Answers

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:

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

I went back to 1.8.3 and it's working great now.

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

like image 180
jtubre Avatar answered Oct 11 '22 23:10

jtubre


FWIW, I have the same issue as the original poster. I also recently upgraded to 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.

like image 35
Gabe Cook Avatar answered Oct 12 '22 00:10

Gabe Cook