1

I'm unable to push code into a git server. Please find errors which is shown while pushing into git.

 Counting objects: 7, done.
 Delta compression using up to 2 threads.
 Compressing objects: 100% (3/3), done.
 Writing objects: 100% (4/4), 457 bytes, done.
 Total 4 (delta 1), reused 0 (delta 0)
 Unpacking objects: 100% (4/4), done.
 fatal: Unable to create     '/home/gituser/GIT/poc.git/refs/heads/master.lock': Permission denied
 fatal: The remote end hung up unexpectedly
 fatal: The remote end hung up unexpectedly

Using an Redhat 6 , nginx. Please provide a solution to solve this error. Thank you all in advance.

  • most likely your logged into system as a different user and the code is stored in different username, by the error message git is attempting to update a file but the user your logged in as does not have permissions. Seems to be a user permissions error to that directory not a git error. – Mark Sep 17 '16 at 06:06
  • I have checked the permission , its look like drwsrwsr-x 7 gituser gituser 4096 Sep 17 11:09 poc.git . But i'm pushing code from gitapp (user) to server. – Yaminikarthika N Sep 17 '16 at 06:11
  • Thank you mark for your help. I have solved the error. – Yaminikarthika N Sep 17 '16 at 06:23

1 Answers1

1

With the help of user Andrea , I have solved this error.Here is the link below How to configure an existing git repo to be shared by a UNIX group

 cd <project.git>
 git config core.sharedRepository group
 chgrp -R (user) .  # user - which user is going to push 
 chmod -R g+w .
 chmod g-w objects/pack
 chmod g+s 'find . -type d'

Run these commands and try it. Now you can able to push code in git repository. Once again thank you andrea and Mark.

Community
  • 1
  • 1