Skip to content

Git Branching

common actions

action command note
create git checkout -b branch_name create branch and switch to it
create git branch branch_name create branch but don’t switch to it
list git branch --list
switch git checkout branch_name
delete git branch -d branch_name

merging

To merge branch1 into main:

git checkout main      ; switch to main branch
git merge branch1      ; merge branch1 into main