15

を使用すると失敗したため、この問題は「Bad git config file .git/configgit init 」とは異なります。

/home/mirror/.gitconfig に問題はないようです:

[mirror@home php]$ git init
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/mirror/.gitconfig

これは ~/.gitignore の内容です:

cat ~/.gitconfig
[alias]
        lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[user]
        email = xxxxxx@gmail.com
        name = xxxxx
[push]
        default = simple
4

6 に答える 6

22

Simple は git v1.7.11 で追加されました。git のバージョンが古い場合、このオプションは存在しません。あなたからそれを削除するだけで、レポconfが可能になります。init

ドキュメントを見る

于 2012-09-06T07:32:21.233 に答える
6

この問題は、git 1.8 がリリースされた現在も発生し続けています。幸いなことに、git からのメッセージは非常に役に立ちます。

warning: push.default is unset; its implicit value is changing in
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)

たとえば、git (vc) への emacs インターフェイスは引数「simple」を認識しないため、当面は引数「matching」を使用した方がよいでしょう。

于 2013-01-15T09:53:46.187 に答える
0

押したり引いたりしたときに得たエラーを検索しているときにこれに出くわしたのでMalformed value for push.default: simple、他の人もそうかもしれないと思いました。

これは、通行人に詳細情報を提供する関連する質問です (その他のリンクについては、最後にある私の回答も参照してください): GIT: Can't Push (Strange Config Issue)

特に、このエラーは古いバージョンの Git がどこかにあるために発生しているように見えることに注意してください。最善の解決策は、すべてのマシンで最新バージョンの Git に更新することです。

これが不可能な場合は、次のコマンドを実行するだけです (@morefromalan で言及されているように)。

git config --global push.default matching

また

git config --global push.default upstream

エラーを取り除くために。これにより、ここpushで説明されているように、操作のデフォルトの動作が変更されます。と同様にこれを行う必要があるかもしれませんが、デフォルトの動作を に変更しただけで機能しているようです。pullpushpushupstream

幸運を!

于 2014-06-12T22:10:11.613 に答える