2015-11-01 81 views
1

在执行:致命:坏数字配置于git的 'core.sharedrepository'/配置值:无效单元(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 

,因为我认为我有实际的命令输入组的名称(这里“开发”是具有用户的组的名称,名为“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 

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

回答

2

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

编号:dev根本就不是该设置的有效值。

请仅尝试'group'。

git config core.sharedRepository group 

如果您需要手动修改配置,一定要认准.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.
+0

是冯,我试图用 '团' 的命令,但输出总是“致命:错误的数字配置值.......'。事实上,执行甚至'git status'也会给出同样的致命错误。我不知道如何恢复'$ git config core.sharedRepository dev'。 –

+0

你在键入什么命令? – VonC

+0

@AshishGoyal你应该可以手动修改'.git/config'文件。 – VonC