git problems
object file is empty
the problem
bash
$ git push
error: object file .git/objects/da/d9cdafce8c6c766b06930f76b44ff7d92c4898 is empty
error: Could not read dad9cdafce8c6c766b06930f76b44ff7d92c4898
To github.com:user/repo.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:user/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
$ git pull
error: object file .git/objects/da/d9cdafce8c6c766b06930f76b44ff7d92c4898 is empty
error: object file .git/objects/da/d9cdafce8c6c766b06930f76b44ff7d92c4898 is empty
error: object file .git/objects/da/d9cdafce8c6c766b06930f76b44ff7d92c4898 is empty
error: object file .git/objects/da/d9cdafce8c6c766b06930f76b44ff7d92c4898 is empty
remote: Enumerating objects: 71, done.
remote: Counting objects: 100% (71/71), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 53 (delta 39), reused 0 (delta 0), pack-reused 0 (from 0)
error: object file .git/objects/51/a9950a76d106bac6e591a53e27daddabb71dc4 is empty
error: failed to read delta-pack base object 51a9950a76d106bac6e591a53e27daddabb71dc4
fatal: unpack-objects failedhow to fix
bash
find .git/objects/ -type f -empty -delete
git fetch -p
git fsck --full