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
相关推荐
Dontla12 分钟前
.gitkeep文件作用(让Git追踪空目录,使该目录能被纳入版本控制)!.gitkeep
大数据·git·elasticsearch
shandianchengzi16 分钟前
【记录】VSCode|Windows 下 VS Code 配置 Git Bash 为默认终端完整教程
windows·git·vscode·bash
EleganceJiaBao26 分钟前
【Git】现代开发工作流(Main + Feature Branch)
git·github
小怪不太怪~28 分钟前
本地项目上传到GitHub--小怪教程(Git Bash实操+常见报错解决
git·github·bash
_codemonster11 小时前
git 容易混淆的点
git
_codemonster14 小时前
Git 最常用操作和原理
大数据·git·elasticsearch
_codemonster1 天前
.git文件夹里所有文件详解
git
01杭呐1 天前
一次错误分支合并导致 `master` 变脏的排查与修复
git
_codemonster1 天前
git本地以及github查看历史版本、版本回退
git·github
周小码1 天前
10分钟搭建私有Git服务器:Soft Serve实战
运维·服务器·git