`error: unable to read sha1 file of src/app.js (3b18e5...)` or `error: inflate: data stream error`
AdvancedTroubleshootingLost Work, HEAD and History Problems
Answer
Likely causes → A loose object or pack is corrupt (disk error, bad memory, interrupted write, sync tool).
Diagnose →
git fsck --full --strict
git count-objects -v
Fix → Move the corrupt object away (mv .git/objects/3b/18e5... /tmp/), run git fetch origin (pulls missing objects from remote), then git fsck again. For a bad pack, run git unpack-objects on salvageable parts or re-clone and copy over unpushed branches via git format-patch or git bundle. Also test the disk and RAM.
Prevent → Use reliable storage, and do not interrupt git gc or repack.
More on Lost Work, HEAD and History Problems
`fatal: Unable to create '/repo/.git/index.lock': File exists.`BeginnerYou added a file to `.gitignore`, but `git status` still shows it as modified.Beginner`fatal: your current branch 'main' does not have any commits yet`Beginner`Author identity unknown *** Please tell me who you are.` and `fatal: unable to auto-detect email address`Beginner`fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.`BeginnerYour commits do not show on your GitHub profile contribution graph.Intermediate