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

  • SEARCH
  • Home
  • 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 6026579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:27:58+00:00 2026-05-23T04:27:58+00:00

We have 3 people using a shared Git repo. We don’t have sudo permission

  • 0

We have 3 people using a shared Git repo. We don’t have sudo permission to create/change the group. Since the machine is safe, we were asked to make the Git global writable(chmod +R o+rw *). However we get this error from time to time.

error: insufficient permission for adding an object to repository database .git/ objects

This happens randomly. When some person pushes his code, I don’t get this error.When another person pushes his code, I got this error again.

I have done git repo-config core.sharedRepository true, but seems to only apply to groups. How do I set Git to make new files global writable?

  • 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-05-23T04:27:59+00:00Added an answer on May 23, 2026 at 4:27 am

    We just came across the same issue. Here’s how we’ve tackled it, in addition to running
    git repo-config core.sharedRepository true.

    Note: this was on an Ubuntu Linux server – you may need different commands on your OS but the approach should be broadly similar. Note that many of these commands will need to be run as root or under sudo.

    Step 1. Create a new, shared group

    For example, developers. Add your developers to it.

    groupadd developers
    usermod -aG developers <username>
    

    Step 2. Change group ownership of the existing repository

    chgrp -R developers /path/to/repo
    

    Also make the files group-writeable:

    chmod -R g+w /path/to/repo
    

    Step 3. Ensure that new directories get created with the group set to the new group name

    In some *nix OSs (e.g. FreeBSD, OS X) the group of newly created files is inherited from the parent directory. On other OSs (e.g. Ubuntu) it’s determined by the group of the creating process. In the latter case you can override that behaviour by setting the setgid flag on the parent directory. So one way to make sure that new directories created by e.g. git pull have the same group as their parent is to periodically run something like this:

    find /path/to/repo -type d -exec chmod g+s {} \;
    

    (i.e. find all files under /path/to/repo of type directory and run chmod g+s on them to set the setgid flag.)

    Another way you might approach this is by making developers the primary login group for all developers:

    usermod -g developers <username>
    

    (Note that this may result in a user no longer being a member of their previous primary login group, typically the group with the same name as the username. Use usermod -aG old_group usernanme to restore that membership.)

    Using usermod -g developers means that when a user creates new files they will be default be owned by user:username, group:developers. However, new files will typically be created so that they’re only user-writeable, not group-writeable. (i.e. if you run touch foo; ls -l foo you’ll see the permissions mask as -rw-r--r--.) To have new files you create be group-writeable by default, add umask 0002 to the end of your .profile or .bash_profile file.

    echo umask 0002 >> ~/.profile
    

    Phew! Hope this helps. I’m sure this process isn’t perfect and it’s definitely not a one-size-fits-all, but hopefully it’ll give you some pointers. I’ve made it a community wiki so that others can add to it.

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

Sidebar

Related Questions

Ever since the publication of Enterprise Integration Patterns people have been using the notation
I have an access database with 3 tables. People Gifts PeopleGifts Using VS 2008,
I am trying to understand if I really have any case for using git/mercurial.
At work I am using a svn repository shared among 7 people. To avoid
I have a many-to-many relationship between People and Departments since one person can be
What memory leak detectors have people had a good experience with? Here is a
What solutions have people come up with to develop their web applications offline when
People have been developing own solutions to the following problems: Consistent messaging frameworks for
Some people have suggested that when doing an estimate one should make a lower
I have seen people say that it is bad form to use catch with

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.