GIT上传代码Enumerating objects:类型报错解决,实测可用

博客主要讲述了在使用IntelliJ IDEA的Git功能时遇到的反复出现'Deltacompressionusingupto8threads'错误的问题。问题根源在于Git上传文件大小限制。通过调整Git全局配置,设置http.postBuffer参数为524288000字节可以解决此问题。虽然该方法有效,但问题反复出现的具体原因仍需进一步探究。

最近使用在idea中Git上传代码经常反复出现Enumerating objects: 29, done. Delta compression using up to 8 threads Total开头的这个问题。经过网上查询与实操,发现问题是由于Git文件上传大小引起的,需要使用Git命令执行扩容:

$ git config --global http.postBuffer 524288000


$ git config https.postBuffer 524288000

上面语句实测可用,但是 具体每次更改后反复出现问题的原因有待确定,欢迎大佬点明。

Cloning into '/data/data/com.termux/files/home/buildAPKs/opt/api/github'... remote: Enumerating objects: 1638, done. remote: Counting objects: 100% (29/29), done. remote: Compressing objects: 100% (29/29), done. remote: Total 1638 (delta 0), reused 0 (delta 0), pack-reused 1609 (from 1) Receiving objects: 100% (1638/1638), 230.23 KiB | 613.00 KiB/s, done. Resolving deltas: 100% (814/814), done. Activating wake lock: DONE Creating symlinks: DONE Updating buildAPKs: 'init.bash' is loading sources from repository submodule 'https://github.com/BuildAPKs/buildAPKs.entertainment' into buildAPKs. This may take a little while to complete: Updating module ~/buildAPKs/sources/entertainment to the newest version... error: pathspec 'https://github.com/BuildAPKs/buildAPKs.entertainment' did not match any file(s) known to git error: pathspec 'sources/entertainment' did not match any file(s) known to git Cloning into '/data/data/com.termux/files/home/buildAPKs/sources/entertainment'... remote: Enumerating objects: 77, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (50/50), done. remote: Total 77 (delta 7), reused 70 (delta 7), pack-reused 0 (from 0) Receiving objects: 100% (77/77), 43.82 KiB | 435.00 KiB/s, done. Resolving deltas: 100% (7/7), done. BuildAPKs init.bash prep.bash: Processing elements in directory /data/data/com.termux/files/home/buildAPKs/sources/entertainment/: Please wait... Running 'sha512sum --quiet -c sha512.sum' in directory '/data/data/com.termux/files/home/buildAPKs/sources/entertainment': DONE BuildAPKs init.bash prep.bash /data/data/com.termux/files/home/buildAPKs/sources/entertainment/: DONE Getting https://github.com/twuster/Rubix/tarball/51be3c6c808ff95d0533ad77deac088c2af49f80 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--: 0 0 0 0 0 0 0 0 --:--:-- --:--: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 95862 0 95862 0 0 59563 0 --:--:-- 0:00:100 148k 0 148k 0 0 93476 0 --:--:-- 0:00:01 --:--:-- 3646k Populating /data/data/com.termux/files/home/buildAPKs/sources/entertainment/twuster/Rubix/: twuster-Rubix-51be3c6/AndroidManifest.xml BuildAPKs init.bash prep.bash: Processing elements in directory /data/data/com.termux/files/home/buildAPKs/sources/entertainment/twuster/Rubix: Please wait... BuildAPKs init.bash prep.bash /data/data/com.termux/files/home/buildAPKs/sources/entertainment/twuster/Rubix: DONE Getting https://github.com/uvwxy/android-snappy/tarball/e5c16c6bc72ce70d7a667e3d94a14c068e5bb30b % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:100 9 100 9 0 0 14 0 --:--:-- --:--:-- --:--:-- 14 tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors Retrieving project archive from https://github.com/BuildAPKs/buildAPKs.tarballs/e5c16c6bc72ce70d7a667e3d94a14c068e5bb30b % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 47 ms: Could not connect to server Populating /data/data/com.termux/files/home/buildAPKs/sources/entertainment/uvwxy/android-snappy/: tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors ERROR return value 1 received by init.bash ma.bash init.bash trap.bash: Exiting due to error signal AndroidManifest.xml near or at line number 54 by `grep` with return value 1.,. BuildAPKs init.bash ma.bash init.bash trap.bash ERROR: Generated script error signal tar near or at line number 54 by `(` with return value 212,.[0m Signal 212 exit received by init.bash ma.bash trap.bash: Exiting... setup.buildAPKs.bash : DONE 🏁
最新发布
08-16
你看到的 Git 输出: ``` remote: Enumerating objects: 4497, done. ``` 是 Git 在从远程仓库拉取(fetch)或推送(push)数据时的正常进度信息。它表示 Git 正在枚举远程仓库中的对象(即 Git 的 commit、tree、blob 等对象),以便进行数据传输。 --- ## 🔍 详细解释 - `Enumerating objects`:Git 正在扫描远程仓库中的对象数据库,找出哪些对象是本地没有的,需要下载。 - `4497`:总共需要处理的对象数量。 - `done`:当前阶段已完成。 这是 Git 的 **打包传输机制** 的一部分。Git 会通过以下步骤进行数据传输: 1. **Enumerating objects**:列出所有需要传输的对象。 2. **Counting objects**:统计对象数量。 3. **Compressing objects**:压缩对象以便传输。 4. **Receiving objects** / **Writing objects**:接收或写入对象到本地仓库。 5. **Resolving deltas**:解析增量对象,节省传输体积。 --- ## ✅ 示例:完整的 Git fetch/pull 输出流程 ```bash $ git pull origin main remote: Enumerating objects: 4497, done. remote: Counting objects: 100% (123/123), done. remote: Compressing objects: 100% (80/80), done. remote: Total 200 (delta 100), reused 150 (delta 50), pack-reused 77 Unpacking objects: 100% (200/200), 1.23 MiB | 1.03 MiB/s, done. From https://gitlab.com/your/repo * branch main -> FETCH_HEAD * [new branch] main -> origin/main Updating 1a2b3c4..5d6e7f8 Fast-forward README.md | 2 ++ 1 file changed, 2 insertions(+) ``` --- ## ⚠️ 如果卡在 `Enumerating objects`,可能的原因: 1. **网络问题**: - 远程仓库访问慢或不稳定。 - 使用 `git config --global http.postBuffer 524288000` 增大缓冲区。 - 使用代理:`git config --global http.proxy http://127.0.0.1:1080` 2. **仓库过大**: - 可尝试浅层克隆:`git clone --depth 1 <url>` 3. **权限问题**: - SSH 密钥未正确配置,导致无法拉取数据。 - 使用 `ssh -T git@github.com` 或 `ssh -T git@gitlab.com` 测试连接。 4. **服务器问题**: - GitLab/GitHub 服务暂时不可用或响应慢。 --- ## ✅ 如何优化 Git 拉取速度? - **浅层克隆**(适用于只关心最近提交): ```bash git clone --depth 1 https://gitlab.com/your/repo.git ``` - **只拉取特定分支**: ```bash git clone -b <branch-name> --single-branch <repo-url> ``` - **使用压缩选项**: ```bash git config --global pack.threads 1 ``` --- ##
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值