Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal: bad numeric config value for 'core.sharedrepository' in .git/config : invalid unit (in Git Bash)

On performing :

$ git push -u origin --all

I got an error:

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

I googled, and find out a solution by Richard Hansen.

I had to perform:

$ git config core.sharedRepository group

Rather, I executed it as:

$ git config core.sharedRepository dev

because i thought I have to enter name of group in the actual command(here "dev" is the name of the group which has a user, named "gituser").

Since then, whenever I am trying to execute any command in Git Bash, it is saying:

fatal: bad numeric config value 'dev' for 'core.sharedrepository' in .git/config: invalid unit

For this too, I found a solution at this link

which says:

When you enter an invalid value for git config core.sharedRepository, it may fail continuously rather than let you update again with this command:

git core.sharedRepository group

In which case you will need to open up the .git/config file and alter the file manually, like so:

[core]
    ...
    sharedRepository = group

I did this, but all in vain. Still any command in Git Bash gives the same error :

fatal: bad numeric config value 'dev' for 'core.sharedrepository' in .git/config: invalid unit

Can somebody please help me in solving this issue. Thanks in advance.

like image 986
Ashish Goyal Avatar asked Nov 01 '15 08:11

Ashish Goyal


1 Answers

I thought I have to enter name of group in the actual command

No: dev is simply not a valid value for that setting.

Try 'group' only.

git config core.sharedRepository group

If you need to modify manually the config, make sure to look for the .git/config file in your local cloned repo (not on the server).

The correct values are:

core.sharedRepository

  • group (or true): the repository is made shareable between several users in a group (making sure all the files and objects are group-writable).
  • all (or world or everybody): the repository will be readable by all users, additionally to being group-shareable.
  • umask (or false): Git will use permissions reported by umask(2).
  • 0xxx: where 0xxx is an octal number, files in the repository will have this mode value. 0xxx will override user’s umask value (whereas the other options will only override requested parts of the user’s umask value).

Examples:

  • 0660 will make the repo read/write-able for the owner and group, but inaccessible to others (equivalent to group unless umask is e.g. 0022).
  • 0640 is a repository that is group-readable but not group-writable.
like image 61
VonC Avatar answered Sep 23 '22 19:09

VonC