我正在一台全新安装的Linux Mint上操作。
在尝试从任何存储库中推送时,我遇到了以下错误:
error: Malformed value for push.default: simple
error: Must be one of nothing, matching, tracking or current.
fatal: bad config file line 8 in /home/leng/.gitconfig
fatal: Could not read from remote repository.
这很奇怪,因为我肯定有一个支持简单推送行为的版本。
git --version
命令的输出是 git version 1.8.3.2
。
~/.gitconfig
文件的内容:
[user]
name = My Name
email = MyEmail@website.com
[color]
ui = true
[push]
default = simple
这就是让人毛骨悚然的地方了。
如果我将行为更改为matching
(或者更改为 nothing
, tracking
, 或者 current
),然后尝试push,我会收到完全相同的错误消息。这怎么可能?它是否以某种方式缓存了配置?我甚至尝试重新启动过。我甚至尝试完全从系统中清除GIT(并删除 ~/.gitconfig
)然后重新安装。
如果我从.gitconfig文件中完全删除[push]
部分(或者完全删除该文件),然后尝试push,那么我会得到这个:
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
error: Malformed value for push.default: simple
error: Must be one of nothing, matching, tracking or current.
fatal: bad config file line 8 in /home/leng/.gitconfig
fatal: Could not read from remote repository.
...所以看起来它既承认我没有选择推送行为,但又说我选择了不支持的行为。这到底是怎么回事?
即使我完全删除~/.gitconfig
,我仍然会收到错误信息。
有人能帮我解决这个问题吗?
谢谢!
编辑:
这里是要求的.git/config
文件:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://{my remote repo}
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master