折腾:
【未解决】批量处理gitbook的脚本时忽略掉已处理的book
期间,先去解决git的问题:
1 2 3 4 5 6 7 8 9 10 11 | cd /Users/crifan/dev/dev_root/github/github .io /crifan .github.io crifan@licrifandeMacBook-Pro ~ /dev/dev_root/github/github .io /crifan .github.io master git pull 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: failed to run repack Already up to date . |
git pull fatal failed to run repack
说是VS有问题。
关闭VSCode,重启VSCode。再去试试。

问题依旧。
待会试试:
1 | git gc --aggressive --prune=now |
1 2 | mv .git /refs/remotes/origin/HEAD /tmp mv : rename .git /refs/remotes/origin/HEAD to /tmp/HEAD : No such file or directory |
然后
1 | git gc |
很慢,要等待:
1 2 3 4 5 | git gc Enumerating objects: 21046, done . Counting objects: 100% (21046 /21046 ), done . Delta compression using up to 4 threads Compressing objects: 97% (13274 /13619 ) |

1 2 3 4 5 6 7 | git gc Enumerating objects: 21046, done . Counting objects: 100% (21046 /21046 ), done . Delta compression using up to 4 threads Compressing objects: 100% (13619 /13619 ), done . fatal: sha1 file '.git/objects/pack/tmp_pack_VpaJfb' write error: No space left on device fatal: failed to run repack |
刚才是巧了,硬盘空间不足,重新试试
1 2 3 4 5 6 7 8 | git gc Enumerating objects: 21046, done . Counting objects: 100% (21046 /21046 ), done . Delta compression using up to 4 threads Compressing objects: 100% (13619 /13619 ), done . Writing objects: 100% (21046 /21046 ), done . Total 21046 (delta 11484), reused 12484 (delta 6425) Removing duplicate objects: 100% (256 /256 ), done . |
好像好了。
然后再去看看:
1 2 | git pull Already up to date . |

没问题了。
【总结】
此处:
1 | git pull |
报错:
1 2 3 4 5 6 7 8 9 10 11 | 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: failed to run repack Already up to date . |
原因:
好像之前内部执行有问题。
解决办法:
用gc=自动垃圾清理:
1 | git gc |
即可。
转载请注明:在路上 » 【已解决】git pull报错:Auto packing the repository fatal failed to run repack