Git Product home page Git Product logo

Comments (5)

estmendoza avatar estmendoza commented on June 9, 2024 1

@ShawnTylerSchwartz git status gives:
error: object file .git/objects/44/92309858f0267fb9dd34d5847c903f083f722a is empty
error: object file .git/objects/44/92309858f0267fb9dd34d5847c903f083f722a is empty
fatal: loose object 4492309858f0267fb9dd34d5847c903f083f722a (stored in .git/objects/44/92309858f0267fb9dd34d5847c903f083f722a) is corrupt

I ran everything else and it worked again! But it also uploaded a new repository onto Github, so I don't know if that's okay.

Thanks for your help!

from eeb-c177-w20.

shawntschwartz avatar shawntschwartz commented on June 9, 2024

@estmendoza two questions: first, are you inside of your Git repository's folder on your computer; and two, did you do git add -A? Let me know.

from eeb-c177-w20.

estmendoza avatar estmendoza commented on June 9, 2024

@ShawnTylerSchwartz Yes, I'm in /home/eebc177student/Developer/repos/eeb-c177-homework/lab-exercises/week-one where the food-log.txt file is located. After updating my food log, git add -A works fine but it only gives me the error after I write the commit line.

from eeb-c177-w20.

shawntschwartz avatar shawntschwartz commented on June 9, 2024

@estmendoza okay, so this issue is complicated to explain over this forum, but essentially this type of error occurs when the git repository files on the computer become corrupted (possibly through your battery dying while in the middle of a git operation or not properly shutting down your virtual machine and just quitting it).

The following steps are from this article (https://stackoverflow.com/questions/11706215/how-to-fix-git-error-object-file-is-empty), and I have summarized and adapted them to hopefully fix your issues.

First, let's try the following "Git" way of doing this: Please follow these instructions exactly as described or more issues can arise..

  1. Make sure you are in the main part of your eeb-c177-homework git repo (i.e., cd ~/Developer/repos/eeb-c177-homework
  2. Type git status and let me know here what it says exactly
  3. Backup your .git files using the following command: cp -a .git .git-old
  4. find .git/objects/ -type f -empty | xargs rm
  5. git fetch -p
  6. git fsck --full
  7. Then do git status again and let me know here what is says now

This should hopefully fix the issues and allow you to commit, but if not, I would then suggest doing the following: manually make a backup your files from within the local git repository directory to another temporary folder, then delete the local eeb-c177-homework directory off the computer and re-clone from GitHub and then manually paste back in the files that you backed up (I could help you with this if you'd need assistance)

from eeb-c177-w20.

shawntschwartz avatar shawntschwartz commented on June 9, 2024

@estmendoza I see what you're saying; that's the backup. We can clean it up on Monday in lab!

from eeb-c177-w20.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.