LoginSignup
0

More than 1 year has passed since last update.

git fetchしようとしたら fatal: bad object refs/heads/master 2

Posted at

メモやでいつか丁寧に書くかも

remote: Enumerating objects: 1016, done.
remote: Counting objects: 100% (1016/1016), done.
remote: Compressing objects: 100% (349/349), done.
remote: Total 1016 (delta 707), reused 904 (delta 637), pack-reused 0
Receiving objects: 100% (1016/1016), 253.71 KiB | 1.36 MiB/s, done.
Resolving deltas: 100% (707/707), completed with 64 local objects.
fatal: bad object refs/heads/master 2
error: XXXXXXXXXXXXX.git did not send all necessary objects

Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
warning: The last gc run reported the following. Please correct the root cause
and remove .git/gc.log
Automatic cleanup will not be performed until the file is removed.

fatal: bad object refs/heads/master 2
fatal: failed to run repack

何やらgcがうまく動いてくれていないらしい

2.3時間つまった

原因掴めてないけどいらないファイルを消してあげると動く
調べなくてわ。。。

解決手順

  1. 邪魔していたものを消す
  2. エラーログに書かれていたのでそれを実施
  3. gcを動かしてみる
  4. そしたらあら不思議引っ張ってこれる
rm .git/refs/heads/master\ 2
rm .git/gc.log
git gc
git fetch

Ref

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