Working with git branch

Author: Al-mamun Sarkar Date: 2020-04-12 15:01:22

Working with git branch. The following commands shows how to create branch, switch branch, delete branches.

 

Show list of branches:

git branch

 

Create new branch:

git branch [branch-name]

Example:

git branch develop

 

Switch to branch:

git checkout [branch-name]

Example:

git checkout develop

 

Marge branches:

git merge [branch-name]

Example:

git merge develop

 

Delete a branch:

git branch -d [branch-name]

Example:

git branch -d develop