title: How to switch (or checkout) to a existing remote branch in Git without facing detached HEAD
body: <p>At first when I clone the Git repository I am in the <strong>master branch</strong>. But I have already created a remote <strong>develop branch</strong>. I run <code>git fetch origin develop</code>. Then, I use  <code>git checkout develop</code> and it switched to a new branch develop like this:</p>
  <p><a href="https://i.stack.imgur.com/iJ1Lv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iJ1Lv.png" alt="enter image description here" /></a></p>
  <p>It creates local new develop branch. How to switch to my <strong>origin develop branch</strong> remote one. If I use <strong>git checkout origin/develop</strong>.
  It comes like this:</p>
  <p><a href="https://i.stack.imgur.com/0gXJp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0gXJp.png" alt="enter image description here" /></a></p>
  <p>How can I switch to my remote develop branch?</p>