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
相关推荐
减瓦4 小时前
Windows 环境使用 Git Bash 最佳实践
windows·git
史呆芬4 小时前
CodeX多仓库提交Skill搭建
git·后端·openai
城东5 小时前
Git使用[原意要新建分支提交但是误提交到原来分支恢复办法]
git·原意要新建分支提交·但是误提交到原来分支
开发者联盟league6 小时前
git 压缩本地最近多个commit
git
赵庆明老师15 小时前
Vben精讲:04-了解VSCode中的Git
ide·git·vscode
Irissgwe21 小时前
第 5 篇:Git 分支基础:branch、checkout、merge 和冲突解决
git
liberalhumblehopeful1 天前
git代码管理-分支差距过大如何进行同步
git
一只楚楚猫1 天前
一篇文章入门Git工具
git
Irissgwe1 天前
第 6 篇:Git 分支进阶:分支策略、stash、bugfix 和 feature 开发
git
wok1571 天前
Git Bash 执行中文命令报错 127:MSYS 参数编码 bug 排查与修复
git·bug·bash