I am using git on windows. This is what I did: doing development on machine M1, created bare repository on USB drive M2 to backup the repository on M1. I did backups using this command (from git bash on M1):
git push --mirror "f:\repo"
Worked without any issues. Then I bought a new machine M3. I cloned the repository from M2 to M3:
git clone "f:\repo" .
Made some checkins to the repo in M3. Then I did (from git bash on machine M3)
git push --mirror "f:\repo"
I get this error: unable to write sha1 filename … Permission denied How can I fix this?
Bit late but none of these worked for me. I had to run sudo git gc
in the remote repository and that somehow fixed all my problems.
After that I pushed again and it worked
Even if it is about a different context (git+ssh), check the ACL associated with your repo.
See for instance this blog post.
As suggested in the SO question "Git pull error: unable to create temporary sha1 filename" (which has other interesting suggestions as well), try redoing your bare repo, this time with the config:
git config core.sharedRepository true
Ran into this error because of permissions on distant respository. In my case it was the ssh user which was the wrong one for rights.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With