Source Tree Error Please Help

fatal: Unable to create 'C:/Users/Jon/Documents/DoomCarts/.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.

How can we commit?

4 answers

Hi Dfg,

If you're not running other GIT process, just delete the C:/Users/Jon/Documents/DoomCarts/.git/index.lock file and try again.

Kind Regards,
Henrique Lechner

Correct. Which is what the error message is telling you to do.

If you can't find the .git folder, you may need to change your Windows File Explorer options to show hidden folders, or type the path directly into your address bar.

I get this a lot when switching branch. Sometimes it's enough to just wait a couple of seconds and then try again. Other times I need to Exit SourceTree and start it up again before being able to switch branch.

This is a known bug: https://jira.atlassian.com/browse/SRCTREEWIN-5639

You should open that bug and vote for it, to give it more priority.

 

As a work-around, use the solution proposed by Henrique Lechner:

If you're not running other GIT process, just delete the C:/Users/Jon/Documents/DoomCarts/.git/index.lock file and try again.

This happened to me and while sourcetree kept telling me the lock file existed, there was no such a file there for me to remove. So I just checked out another branch and then returned to the original branch and noticed this change fixed the issue.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

273 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot