当你运行时:
git push origin ...
中设置的remote.origin.push任何内容都会覆盖中设置的任何内容push.default。更一般地说,如果没有设置(这里是),git 会退回到,然后如果也没有设置,它会退回到链接中描述的内置默认值。remote.name.pushnameoriginpush.default
(编辑:如以下 Breaking Benjamin 的评论和我对它的回复中所述,如果有一部分...包含至少一个 refspec,则 refspec 会覆盖remote.origin.push。因此,remote.origin.push仅当您origin在命令行上显式或隐式命名并省略任何和所有时才适用命令行上的 refspecs 也是如此。例如,git push没有发现的参数origin,或者git push origin没有其他参数,Git 会查找您的remote.origin.push设置并使用它;但git push origin xyz 不使用您的remote.origin.push设置。当然...上面的部分可以包含更多标志,所以此时正确的问题是...部分包含任何参考规范。)
注意:
git config --local na.me value
和没有的意思一样--local。设置值时(如此处)--local,--global、 和选项控制设置值的位置,但为默认值。--file filename--local
(获取值时:
git config na.me
[or git config --getor git config --get-allor git config --get-regexp], the--local等选项限制了 git 从哪里读取,如果没有它,它会从所有这些选项中读取,如果在多个地方设置了某些内容,则“最本地化”会覆盖“不太本地化”。 )