LoginSignup
16
18

More than 1 year has passed since last update.

【Git】「error: cannot lock ref ~」エラーが出る

Posted at

個人的な備忘録です。

事象

  • リモートブランチを削除した後に、gitコマンドを叩くと「error: cannot lock ref ~」エラーが出る
  • fetch も pull も push もできない

調査

原因

  • ローカルに到達不能な追跡ブランチがのこっていたことが原因とのこと

解決方法

  • prune(〈余分な枝を〉おろす,切り取る)で、到達不能なコミットを掃除するために、以下のコマンドを叩く
git remote prune origin
16
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
18