2

How do I creates groups for permission access in git?

Background/Issue

I am the owner/creator of a bare, local git repo which is stored on a shared drive at my work. I had a new coworker test to ensure they can push/pull. Cloning and pulling work just fine for them, but they cannot push. Please note that this is the first coworker of mine to attempt to push to the repo.

Prior to them cloning the repo I ensured all braches were up to date. I have since tested pushing and pulling from my laptop and desktop and am not having any issues (but my coworker still is).

Error

The error my coworker is getting is only from pushing (below). Cloning and pulling works fine.

error: remote unpack failed: unable to create temporary object directory

To remotedir

~ [remote rejected] Head -> master (unpacker error)

error: failed to push some refs to remotedir

Possible Solution

I've reviewed multiple articles and believe the solution has to do with permissions; however, I cannot execute the solutions because I don't know how to add/create/edit groups.

Article closest to my issue: How to configure an existing git repo to be shared by a UNIX group

I originally set up the repo using git init --bare, but I forgot to include a tag for sharing. It seems this was a big mistake.

In below example existing repository = repodir and group = foo. How do I create the group foo, and how do I assign both my coworker and myself to that group?

chgrp -R foo repodir                 # set the group
chmod -R g+rw repodir                # allow the group to read/write
chmod g+s `find repodir -type d`     # new files get group id of directory
git init --bare --shared=all repodir # sets some important variables in repodir/config ("core.sharedRepository=2" and "receive.denyNonFastforwards=true")

How do I create/edit/manage group? Would I be able to do this in git?

Edit -- Moved sentences around and removed some for clarity

Community
  • 1
  • 1
dblum49
  • 21
  • 2

0 Answers0