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
相关推荐
小毛驴85021 小时前
所有微服务部署都使用一个git地址,并且通过docker部署各个服务的情况下,如何编写mvn指令来处理各个服务。
git·docker·微服务
国王不在家21 小时前
git 切换仓库后清理分支缓存
git
柯南二号1 天前
【Gitlab】Ubuntu 20.04服务器部署Gitlab
git·gitlab
phac1231 天前
git 如何直接拉去远程仓库的内容且忽略本地与远端不一致的commit
大数据·git·elasticsearch
ficker132 天前
git常用命令
git
kevin_cat2 天前
微信群机器人-备份文件发送通知
git·bash·企业微信
程序媛Dev2 天前
50.4k Star!我用这个神器,在五分钟内搭建了一个私有 Git 服务器!
运维·服务器·git
澈轩2 天前
Git 用得好,下班走得早
git
人间造梦工厂2 天前
Git Bash 别名
git
画个太阳作晴天2 天前
解决 Android Studio 中 build 目录已被 Git 跟踪后的忽略问题
git