Skip to content

Prevent "cannot lock ref" git error #47141

Closed

Description

> 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)

Activity

  1. added
    bug
    git
    on Apr 3, 2018
  2. joaomoreno commented on Apr 3, 2018

    @joaomoreno
    ContributorAuthor

    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)

  3. joaomoreno commented on Jun 28, 2018

    @joaomoreno
    ContributorAuthor

    Also: fatal: Cannot rebase onto multiple branches.

  4. Kalela commented on Jul 25, 2018

    @Kalela

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

  5. ramya-rao-a commented on Sep 27, 2018

    @ramya-rao-a
    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
  6. joaomoreno commented on Sep 28, 2018

    @joaomoreno
    ContributorAuthor

    Oh this can happen on fetch too. Great catch.

  7. added a commit that references this issue on Sep 28, 2018
    087ee56
  8. isidorn commented on Sep 28, 2018

    @isidorn

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

  9. isidorn commented on Sep 28, 2018

    @isidorn

    This is timing dependent, and I actually tested the build which does not have the fix. So leaving to Ramya Rao (@ramya-rao-a) to verify on her machine
    Ramya Rao (@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

  10. locked and limited conversation to collaborators on Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buggitverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions