# .git/Object file is corrupt

**URL:** <https://discourse.nodered.org/t/git-object-file-is-corrupt/47997>\
**Category:** General\
**Created:** [4 July 2021 07:06 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997 "2021-07-04T07:06:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 07:06 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/1 "2021-07-04T07:06:20Z")

</div>

I started NR in the virtual box after some time. and After creating flow when I try to deploy I got this error. What can be done?

```auto
Error: error: object file .git/objects/4d/b2a0367fbacc3376b2a2d94b6f65fc5bccf95d is empty
error: object file .git/objects/4d/b2a0367fbacc3376b2a2d94b6f65fc5bccf95d is empty
error: object file .git/objects/4d/b2a0367fbacc3376b2a2d94b6f65fc5bccf95d is empty
fatal: loose object 4db2a0367fbacc3376b2a2d94b6f65fc5bccf95d (stored in .git/objects/4d/b2a0367fbacc3376b2a2d94b6f65fc5bccf95d) is corrupt

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 July 2021 07:23 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/2 "2021-07-04T07:23:12Z")

</div>

Which .git folder is it taking about?  
At what stage does this happen? Show us what comes before and possibly after that message.

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 07:25 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/3 "2021-07-04T07:25:23Z")

</div>

I don't know which git folder is. I have enabled to project feature.

when I press the deploy button I got this error. Node-red starts without any error. my last time flow is there as it is.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 July 2021 08:02 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/4 "2021-07-04T08:02:57Z")

</div>

I don't use the projects feature but I guess that it is the .git folder for the project that is corrupt.

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 08:06 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/5 "2021-07-04T08:06:47Z")

</div>

Possible. but I don't think I've done any change from outside for project folder.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 July 2021 08:17 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/6 "2021-07-04T08:17:10Z")

</div>

Go into the folder where the repository is (is that the project folder, I don't use projects) and run  
`git fsck`  
that will check the integrity of the folder contents.  
You may get some 'dangling blob' messages but they can be ignored.

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 08:39 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/7 "2021-07-04T08:39:33Z")

</div>

> fatal: not a git repository (or any of the parent directories): .git

got this in project directory

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 July 2021 08:40 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/8 "2021-07-04T08:40:25Z")

</div>

Which directory exactly did you run that in?

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 08:40 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/9 "2021-07-04T08:40:59Z")

</div>

> /home/pranav/.node-red/projects

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 July 2021 08:43 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/10 "2021-07-04T08:43:46Z")

</div>

That is not a git repo. You need to go one level further down into the directory of your actual project.

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 08:46 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/11 "2021-07-04T08:46:12Z")

</div>

after doing git fsck

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8e3a6bded22ea7975f4c05d824c4abd65e4e5507.png)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [4 July 2021 10:14 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/12 "2021-07-04T10:14:26Z")

</div>

Check how much disk space is left in the VM (the `df -h` command is probably what you need)

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [4 July 2021 10:19 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/13 "2021-07-04T10:19:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a0a232a50565b48e9c7414acae1e56bf18f5c28.png)  
this is what I get

---

<div class="post-metadata">

**Author:** ![pranavthakkar](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@pranavthakkar](https://discourse.nodered.org/u/pranavthakkar)\
**Post date:** [5 July 2021 05:18 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/14 "2021-07-05T05:18:14Z")

</div>

is there anything else I can do? @hardillb @knolleary @Colin.  
I'm supposed to delete Ubuntu and reinstall it. but let me ask you first 😅

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 July 2021 07:14 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/15 "2021-07-05T07:14:20Z")

</div>

Of course you don't need to re-install ubuntu. The problem is only related to the specific project (unless you have a hardware problem that has corrupted the repository).  
Have you got the repository linked to a master on github (or other)? If so then you can re-clone it from there, after making a backup of your flows file.  
Otherwise you can re-construct the project from the flow files and others in the project folder. I will have to leave it to others to say exactly how to do that as I don't know exactly how projects work.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 September 2021 07:14 UTC](https://discourse.nodered.org/t/git-object-file-is-corrupt/47997/16 "2021-09-03T07:14:58Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
