AbaelsMacBookPro:pelican abaelhe$ git push
Enumerating objects: 6872, done.
Counting objects: 100% (6872/6872), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4305/4305), done.
remote: error: object 93c3f3e6d30672571d972693d0842a14c4ffed26: hasDotgit: contains '.git'
remote: fatal: fsck error in packed object
error: remote unpack failed: index-pack failed
error: failed to push some refs to
'git@github.com:abaelhe/abaelhe.github.io.git'

Malformed objects in git repository #1692

I searched the issues for hasDotgit and found nobody reporting this issue yet.

I expected to be able to clone this git repository from Github but was unable to with the transfer.fsckobjects option set to true. When fetching objects from a remote this option will make git-fetch-pack check all fetched objects and abort when a malformed object or a broken link is encountered. See https://github.com/git/git/blob/d10e2cb9d0299a26f43d57dd5bdcf2b3f86a30b3/Documentation/config.txt#L2691-L2694 for information on transfer.fsckobjects option.

I tried to clone using the https, git and SSH methods of cloning from your organization's public repository URL. I also attempted to clone from a fork I created.

Here is an example of a failure. It fails on the same object SHA each time (031eba227fde3d82b8962537678701ac0cefbda6).

$ git clone git://github.com/zotonic/zotonic
Cloning into 'zotonic'...
remote: Counting objects: 86634, done.
error: object 031eba227fde3d82b8962537678701ac0cefbda6: hasDotgit: contains '.git'
fatal: Error in object
fatal: index-pack failed

I suggest you run the following to report all of the malformed objects or broken links in the repository since this option will only fail on the first problematic object in the git database.

$ git fsck --full
Checking object directories: 100% (256/256), done.
warning in tree 031eba227fde3d82b8962537678701ac0cefbda6: hasDotgit: contains '.git'
warning in tree 0c8472159b917c6e472a0f65b26be31a57021499: hasDotgit: contains '.git'
warning in tree 14a5cae41e98f08fd2f6d807283f07fc6141e8e9: hasDotgit: contains '.git'
Checking objects: 100% (86634/86634), done.

For reference here is the pertinent git config information for this problem:

$ git config transfer.fsckobjects
true
$ git --version
git version 2.12.2

The git config option fetch.fsckobjects set to true will also cause this error to surface.

When I searched for this tree SHA I found the following reference to it: http://chatlogs.jabber.ru/erlang-talks@conference.jabber.ru/2013/01/11.html

It lists the tree object looking like:

$ git ls-tree 031eba227fde3d82b8962537678701ac0cefbda6
040000 tree cd78065b172904253f823ac55e3210370af1cda1 .git
100644 blob a961122cf332c52bee5e678dd6243515a376c554 Emakefile
100644 blob 08b71726713a5840d2fbe9f671486f1468ddc8f9 License.txt
100644 blob f6aedc90f44016ba45ee6c4b012511cab194a638 Makefile
100644 blob d2ff5f9beb73303a38c88c6be7291bd56ff6a4ce README.txt
040000 tree 6532097400540586342df1748ae64f3456b21652 ebin
040000 tree 0d4e2865bd5c984d6563701231b3b2b9bc58fcec src

It appears as if the reason this tree object is malformed is because it contains a .git tree (aka directory) which is a little inception-like.

The date on the chat references is from 2012, so the commit is definitely not new.

I am not sure what can be done here but thought I would let you know that this will impact more and more people as checking git object integrity and links becomes more important from a security perspective.

SciTech-Github-解决git push时的 Error: hasDotgit: contains '.git'的更多相关文章

  1. git push 时发生 error: failed to push some refs to 错误 (解决办法)

    出现问题的原因:在github上更新了README.md,没有更新到本地仓库.而在本地git仓库又修改了文件,这时使用 git push origin master 推送到远程仓库后就出现了下面的问题 ...

  2. 如何修改git push时的密码

    如何修改git push时的密码 如下: 打开git bash 输入 cd ~/.ssh ls 确定有 id_rsa 和 id_rsa.pub文件 ssh-keygen -p -f id_rsa 第一 ...

  3. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  4. git push报错error: failed to push some refs to 'git@github.com'

    git push报错error: failed to push some refs to 'git@github.com' $ git push -u origin master To git@git ...

  5. Git系列 —— 记一次Mac上git push时总是403的错误

    问题: 今天从github上clone下一个项目,然后修改后git push时总是出现: remote:Permission to lixyou/rw-split-plugin.git defined ...

  6. git clone时出现 error:inflate:data stream error(incorrect data check)

    git clone时出现 error:inflate:data stream error(incorrect data check) fatal:serrious inflate inconsiste ...

  7. git push时提示"fatal: The current branch master has no..."

    git push到远程仓库时提示:fatal: The current branch master2 has no upstream branch. To push the current branc ...

  8. git push时提示"Everything up-to-date"

    从github上git clone下的项目,添加或修改文件后,git push时出现"Everything up-to-date" ,   即“一切都是最新的'. 通过 git s ...

  9. Git报错:error: cannot open .git/FETCH_HEAD: Read-only file system

    Git:git pull时报错 error: cannot open .git/FETCH_HEAD: Read-only file system 查看该文件: 未在网上找到解决办法,重启服务器就好了 ...

  10. 解决git push报错error: failed to push some refs to 的问题

    这个问题发生的背景一般是: 想把自己本地的某个项目关联到远程仓库并推送上去,接着他会做如下操作: 本地项目->远程创建仓库->本地关联远程->推送最新代码 最后一个步骤发生问题: 那 ...

随机推荐

  1. Asp.net core 少走弯路系列教程(七)WebApi 学习

    前言 新人学习成本很高,网络上太多的名词和框架,全部学习会浪费大量的时间和精力. 新手缺乏学习内容的辨别能力,本系列文章为新手过滤掉不适合的学习内容(比如多线程等等),让新手少走弯路直通罗马. 作者认 ...

  2. ArcGIS Desktop 10.7 完美汉化安装教程

    1,下载文件并解压缩,双击[Esri ArcGIS Desktop v10.7.0.exe] 2.在安装向导中选择[Next] 3.选中[I accept the master agreement]我 ...

  3. 揭秘AI自动化框架Browser-use(三):Browser-use控制浏览器的核心机制

    1. 概述 在Browser-use框架中,核心任务是使大模型能够像人类一样操作浏览器.本文深入探讨大模型如何实际控制浏览器,重点解析从模型输出到浏览器动作执行的完整流程. 上一篇(公众号首发)-Br ...

  4. 需要的效果它都有,让AI对话开发效率翻倍!这款Ant Design扩展组件库绝了

    嗨,大家好,我是小华同学,关注我们获得"最新.最全.最优质"开源项目和高效工作学习方法 ant-design-x-vue 是基于 Ant Design Vue 的扩展组件库,专注于 ...

  5. Java Annotation认知(包括框架图、详细介绍、示例说明)--转载

    转载地址:https://www.cnblogs.com/skywang12345/p/3344137.html

  6. MCP 实践系列:EdgeOne 在线部署HTML页面

    今天,我们将专门讲解一下 EdgeOne 在线部署 HTML 页面时所提供的 MCP 功能.这个功能对于个人用户来说非常实用,尤其适合一些小型应用场景,比如开发一个简单的小游戏,或者搭建一个小型网站, ...

  7. RPC实战与核心原理之分布式环境下如何快速定位问题

    分布式环境下如何快速定位 回顾 如何建立可靠的安全体系,关键点就是"鉴权",我们可以通过统一的鉴权服务动态生成秘钥,提高 RPC 调用的安全性. 分布式环境下定位问题有哪些困难 举 ...

  8. JS中常用方法

    数组 splice: splice() 方法的第一个参数是起始索引,第二个参数是要删除的元素数量(可以为0),然后可以传递更多的参数作为要插入的新元素. 限制删除的数量: const arr = [1 ...

  9. 创建字符串对象的六种方法(java)

    package javaBasic; public class StringConstruction { public static void main(String[] args) { String ...

  10. WindowsPE文件格式入门10.TLS表

    https://www.bpsend.net/thread-407-1-1.html 当一个全局变量,所有的线程都会同时访问这个全局变量,其实就是访问同一块内存,有时我们希望所有的内存访问同一块内存, ...