# Bad object in GitHub repo

**URL:** https://meta.discourse.org/t/bad-object-in-github-repo/26134
**Category:** Support
**Created:** [March 9, 2015, 4:58pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134 "2015-03-09T16:58:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![floriandotorg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/floriandotorg/32/115761_2.png) [@floriandotorg](https://meta.discourse.org/u/floriandotorg)
#### Post date: [March 9, 2015, 4:58pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/1 "2015-03-09T16:58:44Z")

</div>

Hi,

we’ve encountered the following problem:

```
git clone https://github.com/discourse/discourse.git
cd discourse/
git show 92dc829df56cf5166bdeb0b2463a0b1bcbac8238
fatal: bad object 92dc829df56cf5166bdeb0b2463a0b1bcbac8238

```

As far as we know, this only occurs on git \>= 2.0.0, git 1.9.3 works fine.  
Neither fsck, repack or gc helps.

The bad object causes many problems, especially when you’re working with submodules.

It would be really helpful, if someone could fix it.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 9, 2015, 8:55pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/2 "2015-03-09T20:55:40Z")

</div>

Can we repro this @sam?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 9, 2015, 9:44pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/3 "2015-03-09T21:44:28Z")

</div>

I can repro, but I have no idea how to fix it.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 9, 2015, 9:46pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/4 "2015-03-09T21:46:37Z")

</div>

I am not sure there is an error here, this is a standard error message:

```plaintext
sam@ubuntu discourse % git show 6666666666666666666666666666666666666666
fatal: bad object 6666666666666666666666666666666666666666

```

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [March 10, 2015, 12:58am UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/5 "2015-03-10T00:58:01Z")

</div>

I found it an old repo:

```plaintext
→ git show 92dc829df56cf5166bdeb0b2463a0b1bcbac8238 | head
tag latest-release
Tagger: Neil Lalonde <neillalonde@gmail.com>
Date: Fri Jan 24 15:21:39 2014 -0500

latest release

```

compare to:

```plaintext
→ git show latest-release | head
tag latest-release
Tagger: Neil Lalonde <neillalonde@gmail.com>
Date: Mon Mar 2 18:32:21 2015 -0500

latest release

```

Looks like 92dc… is an orphaned object for an old tag - it would no longer be in the repo on github. It’ll get clobbered when we push a new `latest-release` tag.

After running `git gc`, 92dc… is no longer in my local repo.

@floriandotorg: why did you start using 92dc… ?

---

<div class="post-metadata">

### Author: ![floriandotorg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/floriandotorg/32/115761_2.png) [@floriandotorg](https://meta.discourse.org/u/floriandotorg)
#### Post date: [March 10, 2015, 8:57am UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/6 "2015-03-10T08:57:02Z")

</div>

@supermathie Thanks for your help.

We don’t use it, git complains about this bad object on `git push` with `--recurse-submodules=on-demand` flag, as well as do many submodule commands.

`git gc` doesn’t remove it on our side.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [March 10, 2015, 2:15pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/7 "2015-03-10T14:15:27Z")

</div>

try: `git fetch --all` to update your tags then `git gc`

Not sure why you would even see it in a fresh repo - it’s not there. Something must be referring to it.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 16, 2018, 9:03pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/8 "2018-09-16T21:03:01Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 16, 2018, 9:44pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/9 "2018-09-16T21:44:57Z")

</div>

Simplest fix for anything odd like this on dev is to nuke the repo and start from scratch

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 16, 2018, 9:45pm UTC](https://meta.discourse.org/t/bad-object-in-github-repo/26134/10 "2018-09-16T21:45:08Z")

</div>


