git错误“无法写入sha1文件名...权限被拒绝” [英] git error “unable to write sha1 filename … Permission denied”

查看:3255
本文介绍了git错误“无法写入sha1文件名...权限被拒绝”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上使用git。这就是我所做的:在机器M1上进行开发,在USB驱动器M2上创建裸存储库以备份M1上的存储库。我使用这个命令做了备份(从M1上的git bash):

$ p $ g $ git push --mirror f:\ repo

工作没有任何问题。
然后我买了一台新机器M3。我将存储库从M2复制到M3:

  git clonef:\repo。 

在M3中对回购进行了一些签入。然后我做了(从机器M3上的git bash)

  git push --mirrorf:\repo

我得到这个错误:
无法写入sha1文件名...权限被拒绝
我怎样才能解决这个问题?

解决方案

即使它是关于不同的上下文(git + ssh),请检查与您的仓库相关的ACL。

请参阅博客文章



正如SO问题 Git pull error:无法创建临时sha1文件名(还有其他有趣的建议),尝试重做你的裸回购,这次用配置:

  git config core.sharedRepository true 


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?

解决方案

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

这篇关于git错误“无法写入sha1文件名...权限被拒绝”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆