致命:.git/config 中 'core.sharedrepository' 的错误数字配置值:无效单位(在 Git Bash 中)

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

关于表演:

$ git push -u origin --all

我收到一个错误:

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

我用谷歌搜索,Richard Hansen找到了解决方案。

我必须执行:

$ git config core.sharedRepository group

相反,我将其执行为:

$ git config core.sharedRepository dev

因为我想我必须在实际命令中输入组名(这里"dev"是有用户的组名,名为"gituser")。

从那时起,每当我尝试在 Git Bash 中执行任何命令时,它都会说:

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

为此,我在 this link

找到了解决方案

上面写着:

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

我这样做了,但都是徒劳的。 Git Bash 中的任何命令仍然给出相同的错误:

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

有人可以帮我解决这个问题吗?提前致谢。

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

否:dev 根本不是该设置的有效值。

仅尝试“group”。

git config core.sharedRepository group

如果您需要手动修改配置,请确保在您的 local 克隆存储库(不在服务器上)中查找 .git/config 文件。

正确的值为:

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).

示例:

  • 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.