Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to <a href="http://www.kernel.org/pub/software/scm/git/docs/git-push.html" rel="nofollow noreferrer">git push manual page</a>:</p> <pre><code> git push origin experimental </code></pre> <p>Find a ref that matches <code>experimental</code> in the source repository (most likely, it would find <code>refs/heads/experimental</code>), and update the same ref (e.g. <code>refs/heads/experimental</code>) in origin repository with it.<br> <strong>If <code>experimental</code> did not exist remotely, it would be created</strong>.</p> <p>This is the same as:</p> <pre><code>git push origin experimental:refs/heads/experimental </code></pre> <p>Create the branch <code>experimental</code> in the origin repository by copying the current <code>experimental</code> branch.<br> This form is <strong>only needed to create a new branch or tag in the remote repository when the local name and the remote name are different</strong>; otherwise, the ref name on its own will work.</p> <p>Or, like mentioned in <a href="http://reinh.com/blog/2008/04/18/git-push-just-the-tip.html" rel="nofollow noreferrer">git tip</a>, you can set up a "Branch’s Default Remote":</p> <blockquote> <p>You can use git config to assign a default remote to a given branch. This default remote will be used to push that branch unless otherwise specified.</p> <p>This is already done for you when you use git clone, allowing you to use git push without any arguments to push the local master branch to update the origin repository’s master branch.</p> <pre><code>git config branch.&lt;name&gt;.remote &lt;remote&gt; </code></pre> <p>can be used to specify this manually.</p> </blockquote> <hr> <p><a href="https://stackoverflow.com/users/458170/jan">Jan</a> suggests (for <a href="http://kernel.org/pub/software/scm/git/docs/RelNotes-1.7.0.txt" rel="nofollow noreferrer">git >= 1.7.0</a>) the <code>push -u</code> (or <code>push --set-upstream</code>) option:</p> <blockquote> <p>For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands.</p> </blockquote> <p>That way, you don't have to do any git config.</p> <pre><code>git push -u origin experimental </code></pre>
    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