Git error: remote unpack failed when pushing to a bare repo
EDIT/UPDATE: What actually did the trick for OP was git update-git-for-windows
. See comments for details!
Things I'd try in such situations:
- Make sure my current user owns all the current git-internal files, as lacking permissions can interfere with various git operations.
- Linux:
sudo chown -R --changes "$USER" .git
- Windows: open main folder permissions and let the permissions get rolled down via the Advanced Security Settings dialog (using
☑ Replace all child object permissions with inheritable permissions from this object
)
- Linux:
- On Windows: Make sure the path isn't long, as the Windows filesystem NTFS will mess up git if paths get longer than 255 chars/bytes. Keep in mind that the regular git object paths alone (e.g.
.git/objects/fe/73f087d8c25fbc1159a50434ef9bf15773e7ac
) have a length of 55 characters. Also that special unicode characters can consume more than 1 byte of the file path. Also files in the repo that exceed the maximum path lengths can become problematic for some operations. In worst case just move the repo to e.g.C:\repo\
or something in similar length and try there. - if even that fails and the repo seems completely broken, I'd try cleaning up the repo by cloning it locally
git clone ./repo newrepo
and retry the push from within the new repo clone