search

Home  >  Q&A  >  body text

After the git fetch command is executed, error: cannot lock ref is output.

Two branches were created on gitlab, one of which is named release/sprint12

Then an error was reported when running git fetch. Delete the local folder according to the answer on stackoverflow .git/refs/remotes/origin/release
and then run git fetch again and the same error was reported. The error was as follows:


In addition, I checked under the .git/refs/remotes/origin/release folder. It was empty and there was no sprint12 folder.

Has anyone encountered this problem?

phpcn_u1582phpcn_u15822825 days ago878

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-02 09:44:35

    I know what happened

    1. Run git remote show origin and all information will be displayed, including branches that are deleted remotely but retained locally.


    2. Running git remote prune origin 即可删除本地分支release

    3.Rungit fetch获取新分支release/sprint12

    reply
    0
  • Cancelreply