Git Branching
Check all locally available branches
$ git branchMake a new branch & Switch to new branch
$ git branch <name of the branch> # e.g. git branch dev1
$ git checkout <name of the branch> # e.g. git checkout dev1$ git checkout -b <name of the branch> # e.g. git checkout -b dev1Delete a branch
$ git branch -d <name of the branch> # e.g. git branch -d dev1Delete a branch locally and remotely
Locally
Option 1:
$ git checkout main # first switch to main branch from the branch you want to delete
$ git branch -d <name of the branch to delete>Option 2:
Remotely
Merging two branches:
View local and remote branches
Pull remote branches to local repo
Set up default branch as main/master
Last updated