How to clone whole repository with all branches in git

Sometimes we need all the branches available in our local system. Lets see how can we clone a github repository with all the available branches.

Clone the whole repository as bare. It will copy all the branches.
$git clone –bare .git

Make the bare repository to a regular github repo.
$git config –bool core.bare false

Reset head pointer of git to last state.
$git reset –hard

All the branch will be available
$git branch

I have got this nice info fromĀ

Leave a Reply

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