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



Click to Enlarge


Master branch





How to create a new branch?




git branch <branch_name>





Click to Enlarge


How to switch between branches?




git checkout <branch_name>



Click to Enlarge


How to delete a branch?




git branch –D <branch_name>



Click to Enlarge


Create and check-in the branch in one command




git checkout –b <branch_name>





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 01, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250