push.default仅在未定义参考规范时才有效吗? [英] push.default will work only when no ref spec defined?

查看:62
本文介绍了push.default仅在未定义参考规范时才有效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的查询. push.default仅在未定义参考规范时才会起作用吗?

I have a simple query. Will push.default will work only when no ref spec defined ?

推荐答案

来自git push文档(

当命令行未指定使用< repository>推送到何处时.请参考参数branch.*.remote当前分支的配置,以确定将其推送到何处.如果缺少配置,则默认为原始.

When the command line does not specify where to push with the <repository> argument, branch.*.remote configuration for the current branch is consulted to determine where to push. If the configuration is missing, it defaults to origin.

当命令行未使用< refspec> ...参数或--all,--mirror,--tags选项指定要推送的内容时,该命令将查找默认的< refspec>.通过咨询remote.*.push配置,如果找不到,则使用push.default配置来决定要推送的内容(有关push.default的含义,请参见git-config [1]).

When the command line does not specify what to push with <refspec>... arguments or --all, --mirror, --tags options, the command finds the default <refspec> by consulting remote.*.push configuration, and if it is not found, honors push.default configuration to decide what to push (See git-config[1] for the meaning of push.default).

因此,是否指定遥控器与指定refspec无关,并且何时/如何使用push.default的规则由后者决定.

According to this, whether you specify a remote is handled independently from whether you specify a refspec, and the rules for when/how push.default is used are governed by the latter.

如果需要澄清,该页面上还有很多示例,并且如果您知道所要查找的行为,那么如果仍然有疑问,那么进行测试就不那么困难了.

There are also plenty of examples on that page if clarification is needed, and if you know what behavior you're looking for it shouldn't be that hard to set up a test if still in doubt.

这篇关于push.default仅在未定义参考规范时才有效吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆