git-config的man页面列出了push.default的这些选项:
在大多数情况下,我会认为将代码推送到一个分支的上游分支与推送到同名分支是一样的,因为上游分支通常会有相同的名称,并且同名的分支(“current”)通常(或者根据定义总是?)是上游的。那么有什么区别呢?
更新:git-config的文档已经更新(正如人们所期望的那样),所以现在可能会更清楚地解释其中的区别。
nothing - do not push anything.
matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
upstream - push the current branch to its upstream branch.
tracking - deprecated synonym for upstream.
current - push the current branch to a branch of the same name.
在大多数情况下,我会认为将代码推送到一个分支的上游分支与推送到同名分支是一样的,因为上游分支通常会有相同的名称,并且同名的分支(“current”)通常(或者根据定义总是?)是上游的。那么有什么区别呢?
更新:git-config的文档已经更新(正如人们所期望的那样),所以现在可能会更清楚地解释其中的区别。