Git branch and Git checkout

Let’s learn Git branch and Git checkout commands.

1. To manage your branches, you can use git branch commands. There are few command that you need to learn about.
git branch

Above command is for list the all branches you have. If you want to create a new branch follow the below code.

git branch [NEW_BRANCH_NAME]

If you want to delete a branch, follow this command.

git branch -d [BRANCH_NAME]


2. We can use git checkout command to switch the branches.

If you want to switch already created branch, you need to follow below command.

git checkout [BRANCH_NAME]

If you want to create a new branch and want to switch to that branch,

git checkout -b [NEW_BRANCH_NAME]


Related Git commands and Tutorials.

Thank you for reading. If you are interesting on my article, make sure to follow my other articles as well. Make sure to leave a comment.

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x