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
相关推荐
CC码码2 小时前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码2 小时前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
大卫小东(Sheldon)2 小时前
GIM 1.5发布了! 支持Windows系统了
git·ai·rust
flying jiang3 小时前
将大仓库拆分为多个小仓库
git
李boyang10 天前
Git(四):远程操作
git
荻野泽溪10 天前
Git新建分支并同步到远程
git
漫步企鹅10 天前
【Git】新建一个远程分支的常规操作
git·新建远程分支
潇-xiao10 天前
Linux下的版本控制器Git(15)
linux·笔记·git
@昵称不存在10 天前
Git学习
git·学习
pe7er10 天前
⛔️⛔️⛔️丢弃本地commit,强制采用远端代码
git