【问题标题】:Git Push Failure : unable to migrate objects to permanent storageGit推送失败:无法将对象迁移到永久存储
【发布时间】:2020-06-18 03:08:27
【问题描述】:

我有一个本地存储库,已将其克隆到同一台机器上的另一个目录。

当我对克隆进行一些更改并提交然后推送时 我收到以下错误消息

我再次强调,我从中进行推送的克隆存储库 并且目标存储库是本地的,我对两者都有读/写访问权限。

Rafael@MachineID MINGW64 /i/..path.. /Git Clones/Main_Model_Clone (master)
$ git push
Enumerating objects: 267, done.
Counting objects: 100% (267/267), done.
Delta compression using up to 4 threads
Compressing objects: 100% (146/146), done.
Writing objects: 100% (146/146), 52.46 KiB | 55.00 KiB/s, done.
Total 146 (delta 139), reused 0 (delta 0)
remote: Resolving deltas: 100% (139/139), completed with 120 local objects.
error: unable to write file ./objects/pack/pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.idx: Permission denied
To file://i:/ .. path ..  /Main_Model
 ! [remote rejected] master -> master (unable to migrate objects to permanent storage)
error: failed to push some refs to 'file://i:/ .. path ..  /Main_Model'

遇到这个帖子 What does git mean by, "unable to migrate objects to permanent storage"?

我了解我在远程本地存储库上遇到了权限问题 所以我检查了本地远程目录上的文件:.git/objects/pack 确实有一个文件是只读的

Rafael@MachineID MINGW64 /i/.. path ..  /Main_Model/.git/objects/pack (GIT_DIR!)
$ ls -l
total 1580
-rw-r--r-- 1 udoai14 1049089    8520 מרץ  5 11:41 pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.idx
-r--r--r-- 1 udoai14 1049089 1604176 מרץ  5 13:19 pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.pack

但是按照第一个答案评论中的建议在对象文件夹上执行 chmod -R g+w * 并没有帮助 因为在下一次推送时,文件会从 rw 变回 r-

我也试过了

git config core.sharedRepository true 喜欢这篇文章

https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine

但再次推送会产生同样的错误

【问题讨论】:

    标签: git git-push git-non-bare-repository


    【解决方案1】:

    看来我有一个有两个藏匿处的分支 在我尝试推送的本地远程中。

    使用 git branch -d 删除分支

    并删除存储 git stash list 和 git stash drop

    解决了问题

    【讨论】:

      猜你喜欢
      • 2021-09-14
      • 2017-07-02
      • 2019-02-04
      • 1970-01-01
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 2014-04-28
      • 1970-01-01
      相关资源
      最近更新 更多