Home > Blockchain >  Not able to push files to remote git repository on local Git server
Not able to push files to remote git repository on local Git server

Time:07-29

When I try to push my files to remote repository on a local git server it shows below error. Please help. The remote repository has chmod 777 access. 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 '[email protected]:/srv/git/project.git'***

CodePudding user response:

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

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.
Do a chown -R git:git /srv/git/project.git.
Root has no business owning Git data.

  • Related