2016-04-27 11 views
0

は、私はいくつかのgitエイリアスを設定しようとし、約git config奇妙なことに気づいた。なぜ、 'git config'は複数の設定エントリを作成するのですか?

$ git config user.name foo  # this stores the new name, ok 
$ git config user.name bar baz # this adds a 'name = bar' entry to the config, wtf? 
$ git config user.name qux 
warning: user.name has multiple values 
error: cannot overwrite multiple values with a single value 
Use a regexp, --add or --replace-all to change user.name. 

が、私は疑問に思う理由gitの店舗、複数の値を第二の場合で、いつそれが役立つことができますか?

答えて

1

私はGitの設定でこれを持っている:

[include] 
    path = ~/.gitconfig_user 
    path = ~/.gitconfig_os 

私は外部ファイルからGitの設定の塊から私の設定を構成することができ、複数のフェッチrefspecsを追加するため、ここでの例を参照してください。一貫性のために、Gitではどのキーでも複数の値を指定することができますが、特定のコンシューマにのみ意味があります。

関連する問題