Git Checkout Specific Branch From Remote Repository

Git Checkout Specific Branch From Remote Repository

This article explained, checkout specific branch from git remote repository. In the real time environment, some times we want to checkout only specific branch instead master branch which by default downloaded. After checkout the specific branch, we can verify the branch downloaded or not.

We can use the following command to clone the specific branch from git remote repository.

 

Git Checkout Specific Branch From Remote Repository

Syntax

git clone -b <branch> <remote_repository>

git-develop-branch

 

 

git-clone-url

git-clone-url

 

Example

git clone -b develop https://github.com/narayanatutorial/DecodeIdToken.git

 

Verify the Branch

After downloading the above branch, we can verify by executing the following command.

$ git branch
* develop

 

References

https://devconnected.com/how-to-clone-a-git-repository/

 

 

Leave a Reply