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. 代码随想录第二十七天 | Leecode 455. 分发饼干、 376. 摆动序列、 53. 最大子数组和

    Leecode 455. 分发饼干 题目描述 假设你是一位很棒的家长,想要给你的孩子们一些小饼干.但是,每个孩子最多只能给一块饼干. 对每个孩子 i,都有一个胃口值 g[i],这是能让孩子们满足胃口的 ...

  2. 【经验】C++通过文件句柄获取文件路径(两种方式)

    方法一 主要参考博客:根据文件句柄获得文件名(这篇超级清晰,就是有一点点小问题) 通过文件句柄获得文件路径(这篇不是很好用,但是思路大体是一致的) 主要思路: 根据HANDLE 创建映射文件,调用Ge ...

  3. 【工具】没有人能拒绝这三种PDF阅读方式!打造良好的夜间PDF阅读环境,解放你的双眼!White is too harsh!

    方式一和二都适用于常规的浏览器, 方式三是最最好用的PDF阅读器推荐. 方式一:f12改css 步骤一:打开开发者工具(f12). 步骤二:点击选择PDF所在元素,在style里面加一行filter: ...

  4. 【ROS】5.1 ARP攻击Turtlebot3汉堡Burger并解析移动报文

    原视频 ARP攻击 实验环境推荐:Linux虚拟机×2:Ubuntu 20.04或18.04或kali,被攻击机安装好ROS: 提升能力环境推荐:不同真机下的Linux虚拟机×2:Ubuntu 20. ...

  5. 仿EXCEL插件,智表ZCELL产品V3.0 版本发布,底层采用canvas全部重构,功能大幅扩展,性能极致提升,满足千万级单元格加载

    本次更新是底层全部重构,按照现代浏览器要求,采用canvas方式进行了重构,预留了将来扩展空间,特别是在大数据量性能提升方面有了较大提升,可以满足千万级单元格加载,欢迎大家体验使用. 体验地址:zce ...

  6. Excel 拼接为 SQL 并打包 exe

    关于 Excel 拼接 sql 这个操作, 我已经整过好几篇了, 当然在工作中也是蛮常用的, 今天主要是来写个终篇, 彻底结束它, 然后将代码进行打包为 exe 这样的桌面小软件, 除了自己用, 也可 ...

  7. BP算法完整推导 2.0 (下)

    上篇主要阐述 BP算法的过程, 以及 推导的 4 大公式的结论, 现在呢要来逐步推导出这写公式的原理. 当理解到这一步, 就算真正理解 BP算法了. 也是先做一个简单的回顾一下, 不是很细, 重点在推 ...

  8. 面试题:java Runnable与Callable 的区别

    相同点 都是接口:(废话,当然是接口了) 都可用来编写多线程程序: 都需要调用Thread.start()启动线程. Callable是类似于Runnable的接口,实现Callable接口的类和实现 ...

  9. JAVA实现读取最后几行日志

    JAVA实现读取最后几行日志 1. 背景 在项目框架设计中,针对系统产生的日志,有线上查看日志的需求.日志文件本身很大.线上查看时,开发人员只想了解当前系统产生的错误信息. 2. POM依赖 主要使用 ...

  10. GStreamer开发笔记(五):gstreamer创建组件、管道和总线实现简单的播放器

    前言   前面是自动构建管道.本篇实例化每个元素并将它们链接在一起来手动构建一个管道.  本篇创建管道分为:创建组件,连接组件,获取总线,阻塞提取需要的消息并处理.   Demo      管道图   ...