Git使用问题汇总附带解决方法(持续更新)

Git使用问题汇总附带解决方法

  • [一 git pull 代码时报错: Auto packing the repository in background for optimum performance. See "git help gc"](#一 git pull 代码时报错: Auto packing the repository in background for optimum performance. See “git help gc“)

一 git pull 代码时报错: Auto packing the repository in background for optimum performance. See "git help gc"

问题:git本地仓库,如果长时间不进行清理,拉取代码的时候突然提示: Auto packing the repository in background for optimum performance

原因:本地一些 "悬空对象"太多(git删除分支或者清空stash的时候,这些其实还没有真正删除,成为悬空对象,可以使用merge命令可以从中恢复一些文件)

按步骤执行一下命令:

1.查看悬空对象:

csharp 复制代码
git fsck --lost-found

2.清理悬空对象:

csharp 复制代码
git gc --prune=now

3.再更新代码

csharp 复制代码
git pull
相关推荐
恋喵大鲤鱼20 小时前
git reflog
git·git reflog
MatrixOrigin21 小时前
MatrixOne Git4Data 技术详解(二):从零跑通所有 Git 原语
git
anew___21 小时前
常用的 Git 工作流
git
shimly12345621 小时前
git diff 生成一部分文件的补丁
git
m0_579146651 天前
Git 重置模式详解:四种重置方式的原理与应用场景
git
恋喵大鲤鱼1 天前
git grep
git·git grep
霸王龙的小胳膊1 天前
Git基础知识
git
恋喵大鲤鱼1 天前
git fetch
git·git fetch
Java知识技术分享1 天前
安装sourcetree
java·git·源代码管理
恋喵大鲤鱼1 天前
git revert
git·git revert