title: How to 'git remote add' and track a branch in the same filesystem
body: <p>I have 2 local git archives in /a and in /b which were cloned from remotes/origin.</p>
  
  <p>There is a new branch z on /b</p>
  
  <p>How can I track and fetch branch z from archive /a ?</p>
  
  <p>I tried this:</p>
  
  <pre><code>cd /a
  git remote add b /b
  </code></pre>
  
  <p>This creates 2 config entries, but I did not manage to fetch something or to list remote branches on /a that would show the branches on /b</p>
  
  <hr>
  
  <p>After trying different things I found the following that works:</p>
  
  <p>1) <code>git remote show b</code> lists all the remote branches in b</p>
  
  <p>2) I can fetch using this syntax:</p>
  
  <p><code>git fetch file:///a/ z</code></p>
  
  <hr>
  
  <p>Other things that also work:</p>
  
  <pre><code>$ cd /b
  $ git checkout -b z
  Switched to a new branch 'z'
  $ git pull b z
  </code></pre>
  
  <hr>
  
  <p>But those commands still dont work and I cannot understand why:</p>
  
  <pre><code>git branch -a 
  </code></pre>
  
  <p>does not list the remote branches in b (onlz the ones in origin are shown)</p>
  
  <pre><code>git checkout -t b/z
  </code></pre>
  
  <p>Does not checkout anything but returns an error message</p>