Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, clone a remote <a href="http://en.wikipedia.org/wiki/Git_%28software%29" rel="noreferrer">Git</a> repository and <a href="http://en.wikipedia.org/wiki/Cd_%28command%29" rel="noreferrer">cd</a> into it:</p> <pre><code>$ git clone git://example.com/myproject $ cd myproject </code></pre> <p>Next, look at the local branches in your repository:</p> <pre><code>$ git branch * master </code></pre> <p>But there are other branches hiding in your repository! You can see these using the <code>-a</code> flag:</p> <pre><code>$ git branch -a * master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental </code></pre> <p>If you just want to take a quick peek at an upstream branch, you can check it out directly:</p> <pre><code>$ git checkout origin/experimental </code></pre> <p>But if you want to work on that branch, you'll need to create a local tracking branch which is done automatically by:</p> <pre><code>$ git checkout experimental </code></pre> <p>and you will see</p> <pre><code>Branch experimental set up to track remote branch experimental from origin. Switched to a new branch 'experimental' </code></pre> <p>That last line throws some people: "New branch" - huh? What it really means is that the branch is taken from the index and created locally for you. The <em>previous</em> line is actually more informative as it tells you that the branch is being set up to track the remote branch, which usually means the origin/branch_name branch </p> <p>Now, if you look at your local branches, this is what you'll see:</p> <pre><code>$ git branch * experimental master </code></pre> <p>You can actually track more than one remote repository using <code>git remote</code>.</p> <pre><code>$ git remote add win32 git://example.com/users/joe/myproject-win32-port $ git branch -a * master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental remotes/win32/master remotes/win32/new-widgets </code></pre> <p>At this point, things are getting pretty crazy, so run <code>gitk</code> to see what's going on:</p> <pre><code>$ gitk --all &amp; </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