Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've summarized the difference in your question. <code>upstream</code> pushes to the <em>configured</em> upstream branch, while <code>current</code> assumes the upstream branch has the same name as the <em>current</em> local branch, and pushes to that specific name. In reality, there's no reason to assume a local branch's upstream tracking branch has the same name as the local branch itself. </p> <p>For example, if you work in multiple repositories or across many shared developer remotes, you often end up tracking different forks of the same branch, such as <code>allen-master</code> or <code>susan-master</code>, both of which track the <code>master</code> branch in Allen and Susan's repos, respectively. In this case, <code>current</code> would be the incorrect setting, because those branch names don't exist on their remotes. <code>upstream</code>, however, would work just fine.</p> <p>A more practical example might be tracking both a <code>development</code> and <code>production</code> repository. Your workflow might use a different mainline branch for each, but that might get confusing. Suppose you were a code integrator and wanted to track both repositories' <code>master</code> branches separately.</p> <pre><code>git checkout -b production --track production/master git checkout -b development --track development/master </code></pre> <p>Now you've got two branches that track their respective repositories, neither of which use the <code>master</code> naming convention at all. There's little confusion about the branch names: They explicitly describe what they track. Nevertheless, <code>push.default = current</code> wouldn't make any sense as neither remote contains a <code>development</code> or <code>production</code> branch.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload