title: Switch on another branch (create if not exists), without checking if already exists?
body: <p><code>git checkout -b foo</code> switches on <code>foo</code> branch (even if it doesn't exist, it is created), but if the <code>foo</code> branch already exists it throws an error like this:</p>
  
  <pre><code>fatal: A branch named 'foo' already exists.
  </code></pre>
  
  <p>What's the command that does the following check?</p>
  
  <ul>
  <li>if the branch already exists, just switch on it (<code>git checkout foo</code>)</li>
  <li>if the branch doesn't exist, create it and switch on it (<code>git checkout -b foo</code>)</li>
  </ul>