我試圖建立一些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.
我不知道爲什麼混帳存儲多個值,在第二種情況,當它可能是有用的?