title: Switch current branch in git bare repository
body: <p>I actually want to remove a branch in the bare repository i am working with, but this task hits a dead end because I cannot switch away from the master repository without a 'work tree' which a bare repository does not have.</p>
  
  <p>When I run <code>git branch -d master</code> the output is:</p>
  
  <pre><code>error: Cannot delete the branch 'master' which you are currently on.
  </code></pre>
  
  <p>So I try to switch to another branch called 'develop' by running <code>git checkout develop</code> and the output is:</p>
  
  <pre><code>fatal: This operation must be run in a work tree
  </code></pre>