Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:36:35+00:00 2026-06-06T09:36:35+00:00

The Issue: when multiple users have access to the same working directory, permissions issues

  • 0

The Issue: when multiple users have access to the same working directory, permissions issues can occur in the meta-data if any git operations are performed.

DISCLAIMER: Before you chastise me – I realize sharing a working dir is counter to what Git stands for, and I am not talking about doing anything other than read-only operations in this shared directory – we do all our work in our own local repositories.

I’m open to suggestions as to another way to do what we are trying to do, as our approach is certainly not best practice, but I’m not sure that conversation that would be useful for others to listen to. So for now let me provide some details on why we are doing this:

We have several build-masters on our team. We deploy to Linux servers, and we do our builds there, with build scripts that pull directly from Git. We are not able to use CI (such as Jenkins/cruisecontrol) at this time, so we have a repository that we checkout and do our QA builds from.

There are some git operations that we perform as part of the script. This includes some tagging of commits (stuff gets tagged as QA-current, QA-previous, etc…). So I guess we aren’t actually read-only entirely. Due to the nature of the build script, we run it sudo‘ed as a common user (let’s call that user DevAdmin). I realize this might be a bad practice, and is perhaps the source of the pain, since it forces us to use a shared repo checkout.

This would all be fine, if we were always sudo’ed when in that working dir. The issue is that on occasion, one of us will do a git pull or something similar by accident, without being sudo’ed as DevAdmin. So most of the files in .git are owned by DevAdmin (who performed the initial clone), but whenever we do this, we end up with dir’s in .git/objects that contain files owned by a specific user. And these are created as group-unwritable. I’ve also noticed ORIG_HEAD with wrong ownership, for example. So when we try to do something as DevAdmin, we get issues.

Is there anything that we can do to fix this issue? Right now, we have to recognize that it has happened, and then get a server admin to chown .git back to DevAdmin. Or have the user delete the meta-files in question, or at least chmod them to group-writable. This all seems very bad.

I’ve considered a couple of options that don’t involve changing our build and maintenance processes dramatically:

If we removed group-write access on .git and restricted it to DevAdmin, would that prevent this from happening again? This seems the most straightforward option.

Or is there a way to make everything in .git group-writable, even when it’s newly created? This seems like asking from trouble.

Is there something else obvious I’m missing? I realize that the best thing would probably be to change our process so that users could work in their own repo’s, but in a business setting, the repos can get very large (jars aren’t separated out yet, lots of binary files, etc…), and we can’t have multi-GB repos for everyone’s account. Additionally, our system administrators would have a lot of work ahead of them changing their processes to allow for it.

Any thoughts are appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:36:36+00:00Added an answer on June 6, 2026 at 9:36 am

    There are a number of ways to address this problem. Personally, I’d recommend the following in your existing repository:

    # Create a group named "gitshare" that will share the repository.
    sudo groupadd gitshare
    
    # Add yourself and as many others as you want to the group.
    sudo adduser "$LOGNAME" gitshare
    
    # Everything else needs to run from the top level of your Git repository.
    cd /path/to/repository
    
    # Add group permissions for *new* modifications to repository.
    git init --shared=group
    
    # Fix permissions for existing repository objects.
    chown -R :gitshare "$PWD"
    chmod -R g+swX "$PWD" 
    

    Obviously, you need to make sure that the users have directory traversal permissions all the way to your repository (e.g. user-private directories may cause problems), and that all team members who need access belong to the repository’s shared group. After this initial setup, though, it should “just work.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have multiple a MySQL users to be able to issue commands
I have an application with multiple users with different roles. Each users access to
I have an issue wherein multiple different kinds of logins in a Tomcat backend
I am having an issue with multiple custom controls on the same xpage and
I'm having an issue with multiple markers on google maps - I currently have
i have an issue with uploading multiple files to disk. here is my code.
I am have an issue with my scrollview which holds multiple views. I think
I am currently building an application where I have multiple ways to access the
We have an access database on a file share that has permissions for everyone
We have an MS Access based system that relies on back-end data stored in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.