1

Getting this issue in spring tool suit while fetching/pull latest changes from remote branch. i don't have git bash on my local previously it was working fine right now i am getting below mention issue.

Couldn't lock local tracking ref for update

enter image description here

torek
  • 448,244
  • 59
  • 642
  • 775
Natesh
  • 331
  • 1
  • 4
  • 15

3 Answers3

1

I also encountered same problem lock fail Error After pulling from STS But I removed this problem using GITHUB Desktop tool. Once I executed pull from STS, its showed the dialog box with error as shown above. and a up arrow got appended showing there are some commit to be pushed, enter image description here though I had not made any commits before this pull. The changes from pull were not added to my local project.

I checked on Github Desktop, and it also showed same arrow.

enter image description here

I pushed it from tool, and it was resolved. The changes from pull got added to local project.

Vishesh
  • 133
  • 3
  • 11
0

While you don't have git bash, Eclipse is using its own JGit (java-based implementation of Git)

As recommended in "egit lock fail eclipse", do check if you have any "<refname>.lock" file under .git/refs/". (howlger refers to eclipse issue 417860:

I checked in jgit and egit sources and found that the only occurrence of the text "[lock fail]" is used when fetch fails to update a remote tracking branch.
This can happen if a previous crash didn't cleanup a "<refname>.lock" file which git creates as a lock to guard the ref against concurrent updates.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0
git remote prune origin

solved same problem for me