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
相关推荐
工藤孤独18 小时前
Git Worktree 从零到多智能体实战
git
微尘寒风1 天前
【Git】的安装和使用
java·git
胖大和尚2 天前
Git初始化本地文件夹,并推送到远端
git
啵啵啵12342 天前
Git 底层原理:分支为什么只是一个 41 字节的文件
git
demon75520032 天前
Git Worktree详解介绍
git·worktree
胖大和尚2 天前
当前仓库推送到同一台机器上的另一个文件夹
git
轮到我狗叫了3 天前
git - 版本控制工具 - 对应的常见命令 - 以及无需后续每次手动source conda
git
changxiang3 天前
GIT 备忘
git
DogDaoDao3 天前
Windows 开发提效工具全景指南:60+ 工具的工程化分层配置
windows·git·程序员·开发工具·powershell·everything·msys2
wdfk_prog4 天前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github