title: git bare repositories, worktrees and tracking branches
body: <p>I'm working with a code base where I need to be working on several branches at once for different purposes.  So I clone to a bare repository and then set up some worktrees:</p>
  
  <pre><code>git clone --bare ssh://git@git.example.com/project/repo repo.git
  cd repo.git
  git worktree add ../branch-1 branch-1
  git worktree add ../branch-2 branch-2
  ... someone else creates branch-3 and pushes is ...
  git fetch origin +refs/heads/*:refs/heads/* --prune
  git worktree add ../branch-3 branch-3
  </code></pre>
  
  <p>Now the <code>branch-3</code> worktree isn't set to track the remote tree and trying to make it do so, I get into a horrible mess.</p>
  
  <pre><code>$ cd ../branch-3
  $ git branch -u origin/branch-3
  error: the requested upstream branch 'origin/refs/heads/feature/SW-5884-move-database-container-to-alpine-base-2' does not exist
  hint: ...&lt;snip&gt;
  $ git fetch +refs/heads/*:refs/remotes/origin/* --prune
  $ git branch -u origin/branch-3
  fatal: Cannot setup tracking information; starting point 'origin/feature/SW-5884-move-database-container-to-alpine-base-2' is not a branch.
  </code></pre>
  
  <p>What's the right magic to get this to work?</p>