title: GIT: How do I properly download a remote branch to local?
body: <p>Want to download another remote branch to make maintenace, then push back.</p>
  <p>so I tried:</p>
  <pre><code>git switch another_branch
  fatal: invalid reference: another_branch
  </code></pre>
  <p>tried:</p>
  <pre><code>git checkout --track origin/another_branch
  fatal: 'origin/another_branch' is not a commit and a branch 'another_branch' cannot be created from it
  </code></pre>
  <p>tried:</p>
  <pre><code>git checkout another_branch
  error: pathspec 'another_branch' did not match any file(s) known to git
  </code></pre>
  <p>tried:</p>
  <pre><code>git fetch origin another_branch:another_branch
  From gitlab.my-inc.com:projname/proj
  * [new branch]      another_branch   -&gt; another_branch
  git checkout another_branch
  Switched to branch 'another_branch'
  </code></pre>
  <p>seems good but:</p>
  <pre><code>git pull
  fatal: refusing to merge unrelated histories
  
  git branch -vv
  * another_branch            421f45e normal commit comments
  
  git branch --set-upstream-to origin/another_branch
  error: the requested upstream branch 'origin/another_branch' does not exist
  hint:
  hint: If you are planning on basing your work on an upstream
  hint: branch that already exists at the remote, you may need to
  hint: run &quot;git fetch&quot; to retrieve it.
  hint:
  hint: If you are planning to push out a new local branch that
  hint: will track its remote counterpart, you may want to use
  hint: &quot;git push -u&quot; to set the upstream config as you push.
  </code></pre>
  <p>so, I tried:</p>
  <pre><code>git fetch
  git fetch origin another_branch
  From gitlab.my-inc.com:projname/proj
  * branch            another_branch   -&gt; FETCH_HEAD
  </code></pre>
  <p>and still got:</p>
  <pre><code>git branch --set-upstream-to origin/another_branch
  error: the requested upstream branch 'origin/another_branch' does not exist
  hint:
  hint: If you are planning on basing your work on an upstream
  hint: branch that already exists at the remote, you may need to
  hint: run &quot;git fetch&quot; to retrieve it.
  hint:
  hint: If you are planning to push out a new local branch that
  hint: will track its remote counterpart, you may want to use
  hint: &quot;git push -u&quot; to set the upstream config as you push.
  </code></pre>
  <p>Now I feel totally not human seeing others playing well with their git...</p>
  <p>So please help, and thanks in advance.</p>