2015-11-01 95 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