title: How to do a "git checkout -b <branchname>" from a remote tag
body: <p>I'm trying to create a branch from a remote tag, but it seems there's no way to do it. When I try</p>
  
  <pre><code>git checkout -b test origin/deploy
  </code></pre>
  
  <p>where origin is the remote and deploy is the tag I want to check out, but I get</p>
  
  <pre><code>fatal: git checkout: updating paths is incompatible with switching branches.
  Did you intend to checkout 'origin/deploy' which can not be resolved as commit?
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  I've just discovered that </p>
  
  <pre><code>git fetch --all -t
  </code></pre>
  
  <p>was not working properly for me. While it downloads all branches, it does not download all tags, so when I checked out deploy it was and old tag. Now I execute </p>
  
  <pre><code>git fetch --all &amp;&amp; git fetch -t
  </code></pre>
  
  <p>This way when I create a new branch based on a tag</p>
  
  <pre><code>git checkout -b test deploy
  </code></pre>
  
  <p>the new branch is up to date with the last deploy.</p>