LoginSignup
0
0

reference brokenエラーでGit fetchできない

Posted at

事象

Sourcetreeで作業中にPCが落ちてしまった

まずSourcetreeがエラーで立ち上がらないので、 再インストールから始める。
インストールが終わって、フェッチしようとすると下記エラー

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/Users/hogeuser/AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE" fetch origin
error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken
From https://github.com/*****/*****
! [new branch] master -> origin/master (unable to update local ref)
// エラー終了しました。エラーの内容は上記をご覧ください。

解決方法

'refs/remotes/origin/master': reference broken 壊れてるらしいので
名前を変えてもう一度フェッチしたら自動で新しいmasterを作ってくれました
image.png
PCが落ちたときに終了処理が間に合わずファイルも壊れちゃったみたいです

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