Checking out remote branch in Git

March 07, 2012

Simply blogging this for future reference and in the hope it will be useful for someone else.

To checkout a remote branch into your local use the following commands.

git clone myrepo@git.example.com
git branch -r

Will show you all the remote branches pick the one you like...

For instance for me it would be origin/dave.

Run the following command.

git checkout --track origin/dave

About me

Hello! I'm David Heward, how are you going? I'm a Senior Devops/Build Engineer, specialising in AWS & Cloud Automation. Based in London. Strong 10+ year background in Software development. Have a read of my blog. Have a look at some of my working projects. Contact me at @davehewy or on Linkedin.