This is command to show remote branches:

$ git remote
origin

$ git remote show origin
user@example.com's password:
* remote origin
  Fetch URL: user@example.com:/home/user/git/project.git
  Push  URL: user@example:/home/user/git/project.git
  HEAD branch: master
  Remote branches:
    develop                tracked
    feature/feature1       tracked
    master                 tracked
    release                tracked
  Local branches configured for 'git pull':
    develop                merges with remote develop
    feature/feature1       merges with remote feature/feature1
    master                 rebases onto remote master
    release                merges with remote release
  Local refs configured for 'git push':
    develop                pushes to develop                (up to date)
    feature/feature1       pushes to feature/feature1       (up to date)
    master                 pushes to master                 (up to date)
    release                pushes to release                (up to date)

This is command to checkout remote branch to local, and set the local branch to track remote branch:
git checkout --track origin/branchname

2 thoughts on “Checkout branch from git server to local

  1. Woah! I’m really digging the template/theme of this blog. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appearance. I must say that you’ve done a awesome job with this. In addition, the blog loads super fast for me on Safari. Excellent Blog!

    Reply

Leave a reply to Stefan Auw Yang Cancel reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>