Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-1130

"Force option" if index.lock exists or "Delete index.lock" option

    • Icon: Suggestion Suggestion
    • Resolution: Won't Fix
    • None
    • Git
    • None
    • Win7
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      I've recently encountered this problem:

      git -c diff.mnemonicprefix=false -c core.quotepath=false checkout – source/VersionInfo.cs
      fatal: Unable to create 'C:/Projects/xyz/.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.

      Just not to blame SourceTree : It wasn't his fault

      But I would like to have a little helper button: "Delete index.lock" or "Free lock" or even a Force option might be helpful. Everything I want is remaining in the UI of SourceTree and don't open the stupid Console typing this: >del .git\index.lock.

      Can youo help me?
      Thanks
      Marcel

            [SRCTREEWIN-1130] "Force option" if index.lock exists or "Delete index.lock" option

            use rm -f ./.git/index.lock

            Himaja Kokala added a comment - use rm -f ./.git/index.lock

            I get this every time I try to switch features. Very annoying.

            Craig Muckleston added a comment - I get this every time I try to switch features. Very annoying.

            ivschukin added a comment -

            Wow guys, fix this bug. That's really annoying. Makes ST unusable

            ivschukin added a comment - Wow guys, fix this bug. That's really annoying. Makes ST unusable

            Won't Fix? very nice, thanks. this makes ST unusable.

            vladimir volosunov added a comment - Won't Fix? very nice, thanks. this makes ST unusable.

            Same here, happens to me 90% of the time when I am squashing commits

            Leo Pangan added a comment - Same here, happens to me 90% of the time when I am squashing commits

            tszebeni added a comment -

            This issue makes sourcetree unusable for me. I'm forced to switch using a different tool because of this annoying bug.

            tszebeni added a comment - This issue makes sourcetree unusable for me. I'm forced to switch using a different tool because of this annoying bug.

            I get the index.lock issue multiple times a day when I double-click the branch name in the list in order to check it out. I've tried to chase it down, and it seems that this status git command runs just before the checkout:

            git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false status --porcelain --ignore-submodules=dirty --untracked-files=all

            Then, under 200 milliseconds later the checkout command kicks in while that status command is still performing - and failing because of the index.lock being in use:

            git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false checkout master

            Then 700 milliseconds later the first command is done, releasing the lock. That's why you get the error and when you go and look, the index.lock is not there.

            In the screenshot PID 800 is the status command, and PID 10700 is the checkout.

            Please Atlassian, fix this. Maybe make sure that no two git commands are being invoked simultaneously or something?

            It's driving me crazy! Also, use Sysinternal Procmon when developing desktop apps, you'd be amazed what you'll learn about your app

            Sampsa Lehtonen added a comment - I get the index.lock issue multiple times a day when I double-click the branch name in the list in order to check it out. I've tried to chase it down, and it seems that this status git command runs just before the checkout: git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false status --porcelain --ignore-submodules=dirty --untracked-files=all Then, under 200 milliseconds later the checkout command kicks in while that status command is still performing - and failing because of the index.lock being in use: git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false checkout master Then 700 milliseconds later the first command is done, releasing the lock. That's why you get the error and when you go and look, the index.lock is not there. In the screenshot PID 800 is the status command, and PID 10700 is the checkout. Please Atlassian, fix this. Maybe make sure that no two git commands are being invoked simultaneously or something? It's driving me crazy! Also, use Sysinternal Procmon when developing desktop apps, you'd be amazed what you'll learn about your app

            howellcc added a comment -

            Just thought I'd mention this here as it's been my go-to workaround for a while now. For me, I mostly experience this issue when switching branches by double-clicking on the branch that I want to switch to. But I've found if I right click on that same branch and select "checkout", sourcetree will proceed to switch to that branch as expected, without error.

            Just my observation, and my work around. Hope this helps.

            howellcc added a comment - Just thought I'd mention this here as it's been my go-to workaround for a while now. For me, I mostly experience this issue when switching branches by double-clicking on the branch that I want to switch to. But I've found if I right click on that same branch and select "checkout", sourcetree will proceed to switch to that branch as expected, without error. Just my observation, and my work around. Hope this helps.

            I have the same issue. I would like some sort of indicator that the lock file is still present, it would save me from having to close the error and reclick (which is usually all that it takes...)

            William Jones added a comment - I have the same issue. I would like some sort of indicator that the lock file is still present, it would save me from having to close the error and reclick (which is usually all that it takes...)

            Having the same issue as Robert, Daniel, and Clinton since updating to git 2.5.

            Tim Petermann added a comment - Having the same issue as Robert, Daniel, and Clinton since updating to git 2.5.

              Unassigned Unassigned
              19583e0e53a5 Marcel
              Votes:
              1 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: