git错误"无法写入sha1文件名...权限被拒绝"

mor*_*eus 17 git

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

git push --mirror "f:\repo"
Run Code Online (Sandbox Code Playgroud)

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

git clone "f:\repo" .
Run Code Online (Sandbox Code Playgroud)

在M3中为回购制作了一些签到.然后我做了(从机器M3上的git bash)

git push --mirror "f:\repo"  
Run Code Online (Sandbox Code Playgroud)

我收到此错误:无法写入sha1文件名...权限被拒绝如何解决此问题?

A_t*_*ter 13

有点晚了,但这些都不适合我。我不得不sudo git gc在远程存储库中运行,这以某种方式解决了我所有的问题。

之后,我再次推,它奏效了


Von*_*onC 7

即使它是关于不同的上下文(git + ssh),也请检查与您的repo关联的ACL.
例如,请参阅此博客文章.

正如SO问题中所提出的" Git pull error:无法创建临时sha1文件名 "(其他有趣的建议也是如此),尝试使用配置重做你的裸仓库:

git config core.sharedRepository true
Run Code Online (Sandbox Code Playgroud)