Articles → GIT → Branches In GIT

Branches In GIT






What Are Branches?







How To Get The List Of All Branches?




git branch –a

Or 

git branch


Picture showing the command to get the list of all brances in git
Click to Enlarge


Master Branch





How To Create A New Branch?




git branch <branch_name>




Picture showing the git branch command to create a new branch in git
Click to Enlarge


How To Switch Between Branches?




git checkout <branch_name>


Picture showing the git checkout command to switch between the branches in git
Click to Enlarge


How To Delete A Branch?




git branch –D <branch_name>


Picture showing the command to delete the branch in git
Click to Enlarge


Create And Check-In The Branch In One Command




git checkout –b <branch_name>




Picture showing the command to create and switch the branch in git
Click to Enlarge


How To Rename A Branch?




git branch –m <new branch name>




git branch –m <old branch name> <new branch name>



Posted By  -  Karan Gupta
 
Posted On  -  Thursday, August 1, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250