简体   繁体   English

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

[英]Not able to push files to remote git repository on local Git server

When I try to push my files to remote repository on a local git server it shows below error.当我尝试将文件推送到本地 git 服务器上的远程存储库时,它显示以下错误。 Please help.请帮忙。 The remote repository has chmod 777 access.远程存储库具有 chmod 777 访问权限。 So I dont think it is access related issue.所以我不认为这是访问相关的问题。

***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'***

If you can log on to 10.114.58.68 as git (since it is an SSH URL), check the rights associated with the bare repository in /srv/git/project.git如果可以以 git 的身份登录git (因为它是 SSH URL),请在/srv/git/project.git中检查与裸存储库关联的权限

Make sure, for instance, it is accessible by the group of your user account :例如,确保您的用户帐户组可以访问它:

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

Note: Nothing should be owned by root , beside system files.注意:除了系统文件, root不应拥有任何东西。
Do a chown -R git:git /srv/git/project.git .做一个chown -R git:git /srv/git/project.git
Root has no business owning Git data. Root 没有拥有 Git 数据的业务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM