egit lock fail eclipse

32,134

Solution 1

I could neither fetch nor push nor rebase, and got a "lock fail" error in eclipse too.

The solution I found was to open git bash, go to git folder, then do a git fetch. After this I was able to rebase and push with eclipse.

You can also check in your eclipse preferences/team/git/configuration that you have not set fetch.prune=true because it may cause this problem.

Solution 2

git remote prune origin

solved it for me.

Solution 3

I've seen this a couple times in Eclipse 2019-06 now. Possibly related to tag-creation as it seems to have occurred recently after those events. In any event, I think if you close Eclipse, and delete eclipse-workspace/.metadata/.lock file (and possibly eclipse-workspace/.metadata/.log) it gets better on restart.

Solution 4

The issue for me was that I had a bunch of branches that I had pulled as feature/somename but when I pushed it to remote, they appeared as Feature/somename. Once I solved this f to F issue, things started working as expected.


Prune using EGIT

Also, if you want to prune the repository, you should use GIT GC in order to achieve this. EGIT has an option called Collect Garbage to trigger this. Simply, right click on the repository in the EGIT perspective to see this option.

Solution 5

in eclipse right Click in Project

  • team >remote> Configure fetch for Upstream>
  • Advanced> selecte in ‘source ref’ and ‘destination ref’ your branch
  • Click ‘Add Spec’
  • Check the Force update> Finish >Save and Fetch
Share:
32,134
Admin
Author by

Admin

Updated on November 27, 2021

Comments

  • Admin
    Admin over 2 years

    So at work we all share the same stash were we push and pull our branches and all that good git stuff. So i usually do my pull and push from egit in eclipse (I am not the only one most people here do it this way). but some of my branches have started giving me the [lock fail] "couldn't lock local tracking ref for update". But the thing is there are 75+ people doing it the same way and no one has seen this error. I have done some research and most of it says it is based off name conflicts for example Foo and foo. Egit would get confused on which one to pull because the only difference is a capital letter, but other people are having no issues. I don't know what is going on. Any help would be greatly appreciated.

  • Pyves
    Pyves almost 5 years
    Issues with 2019-06 are tracked by bugs.eclipse.org/bugs/show_bug.cgi?id=548716
  • mercredo
    mercredo almost 5 years
    thank you. worked like a charm, running antergos + eclipse 2019-06.
  • David Wood
    David Wood about 4 years
    Hmm, this worked initially, but then the next egit pull said I was ahead of origin/master. git push from command or eclipse gets me in sync with origin/master, but then the next egit pull goes back to being ahead of origin/master
  • Taha
    Taha almost 4 years
    I renamed the folder name from F (uppercase) to f (lowercase) to get rid of the "f to F" issue.
  • David M. Karr
    David M. Karr almost 3 years
    I have heard of developers in our organization getting this error, and I believe that this situation you describe is the cause of it. The Windows DOS filesystem is case-insensitive, so it thinks that "v10" and "V10" are the same thing, but git does not. I wrote a script to detect these situations, using "uniq -d".
  • Varun Saxena
    Varun Saxena over 2 years
    worked for me, thanks
  • The Dark Knight
    The Dark Knight over 2 years
    git fetch was the one that worked for me as well . Good recommendation .
  • Đỗ Công Bằng
    Đỗ Công Bằng over 2 years
    Do git fetch in git bash worked for me also.