How to clone all remote branches with Git

By | July 9, 2014

Question: I have a master and a development branch, both pushed to remote git repository. How to clone all remote branches with Git


  1. clone the remote git repository: git clone git://
  2. list all hiden local branches: git branch -a

    $ git branch -a  
    * master  
      remotes/origin/HEAD -> origin/master  
  3. create a local tracking branch: git checkout -b another-branch remotes/origin/another-branch

  4. list local branches: git branch, and you will see the local branches

$ git branch  
    * master  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.