0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows 環境で git pull 時に「cannot lock ref 'refs/remotes/origin/con'」エラーが発生する

0
Posted at

問題

git pull を実行したところ、以下のエラーが発生し、ローカルリポジトリの更新に失敗しました。

error: cannot lock ref 'refs/remotes/origin/con'

原因

Windows 環境では、con は予約語のため、con という名前のファイルやフォルダを作成することができません。

Git はリモートブランチ名をローカルではファイルとして管理するため、
origin/con というリモートブランチが存在すると、ロックファイル con.lock を作成しようとして失敗します。

対応

該当するリモートブランチを削除し、今後はブランチ名が Windows の予約語にならないようにします。

参考:
https://learn.microsoft.com/ja-jp/windows/win32/fileio/naming-a-file

環境

  • git version 2.47.0.windows.2
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?