Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent "cannot lock ref" git error #47141

Closed
joaomoreno opened this issue Apr 3, 2018 · 8 comments
Closed

Prevent "cannot lock ref" git error #47141

joaomoreno opened this issue Apr 3, 2018 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues verified Verification succeeded

Comments

@joaomoreno
Copy link
Member

> git pull origin master
From github.com:Microsoft/vscode
 * branch                  master     -> FETCH_HEAD
error: cannot lock ref 'refs/remotes/origin/master': is at 2e4bfdb24fd137a1d2e87bd480f283cf7001f19a but expected 70ea06a46fd4b38bdba9ab1d64f3fee0f63806a5
 ! 70ea06a46f..2e4bfdb24f  master     -> origin/master  (unable to update local ref)
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug git GIT issues labels Apr 3, 2018
@joaomoreno joaomoreno added this to the April 2018 milestone Apr 3, 2018
@joaomoreno joaomoreno self-assigned this Apr 3, 2018
@joaomoreno
Copy link
Member Author

This issue occurs when git-radar is doing a fetch in background and user runs git fetch/pull. Git has index.lock to lock index during a fetch, so you cannot corrupt the index by doing concurrent fetches. Your git command fails because of this lock prevents git modifying index.

michaeldfallen/git-radar#81 (comment)

@joaomoreno joaomoreno modified the milestones: April 2018, Backlog Apr 25, 2018
@joaomoreno
Copy link
Member Author

Also: fatal: Cannot rebase onto multiple branches.

@Kalela
Copy link

Kalela commented Jul 25, 2018

I'm in a team. Recieving this error. What should I do so I am able to pull again?

@hardikmodha
Copy link

@Kalela and For future visitors, This StackOverflow question will help you. https://stackoverflow.com/questions/6656619/git-and-nasty-error-cannot-lock-existing-info-refs-fatal

@ramya-rao-a
Copy link
Contributor

I still see it
image

My steps:

  • Type git pull origin master in the terminal, dont press enter
  • Run the command Git: Fetch, quickly switch to terminal to press enter on the git pull origin master

@ramya-rao-a ramya-rao-a added the verification-found Issue verification failed label Sep 27, 2018
@joaomoreno
Copy link
Member Author

Oh this can happen on fetch too. Great catch.

joaomoreno added a commit that referenced this issue Sep 28, 2018
@joaomoreno joaomoreno removed the verification-found Issue verification failed label Sep 28, 2018
@isidorn
Copy link
Contributor

isidorn commented Sep 28, 2018

Following @ramya-rao-a steps I do not see any errors in vscode -> verified

@isidorn isidorn added the verified Verification succeeded label Sep 28, 2018
@isidorn
Copy link
Contributor

isidorn commented Sep 28, 2018

This is timing dependent, and I actually tested the build which does not have the fix. So leaving to @ramya-rao-a to verify on her machine
@ramya-rao-a note that build from this morning does not have the fix so either test on a newer build or out of source

@isidorn isidorn removed the verified Verification succeeded label Sep 28, 2018
@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Sep 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants