07、Git 遇到的错误

时间:2024-01-26 17:13:21

错误:bad object refs/remotes/origin/HEAD

Removing target/
Fetching origin
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
error: 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.

尝试解决但失败:

$ git gc
fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack

最终解决:

$ mv .git/refs/remotes/origin/HEAD /tmp
$ git gc

Failed to connect to github.com port 443: Operation timed out

关闭VPN 试试,2020-02-20