无法将文件推送到本地git服务器上的远程git存储库



当我试图将文件推送到本地git服务器上的远程存储库时,它显示以下错误。请帮忙。远程存储库具有chmod 777访问权限。所以我不认为这是访问相关的问题。

***nips@nips-OptiPlex-5090:~/myproject$ git push origin master
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 12 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (9/9), 1.35 KiB | 1.35 MiB/s, done.
Total 9 (delta 3), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To 10.114.58.68:/srv/git/project.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@10.114.58.68:/srv/git/project.git'***

如果您可以以git的身份登录10.114.58.68(因为它是SSH URL(,请检查/srv/git/project.git中与裸存储库相关的权限

例如,请确保您的用户帐户组可以访问它:

cd /srv/git/project.git                   # Enter inside the git repo
git config core.sharedRepository group    # Update the git's config
chgrp -R <group-name> .                   # Change files and directories' group
chmod -R g+w .                            # Change permissions
chmod g-w objects/pack/*                  # Git pack files should be immutable
find -type d -exec chmod g+s {} +         # New files get directory's group id

注意:除了系统文件之外,root不应拥有任何内容
执行chown -R git:git /srv/git/project.git
Root没有拥有Git数据的业务。

相关内容

  • 没有找到相关文章

最新更新