Branches

Create a new branch

Use the -b flag
git checkout -b <new-branch-name>
Switched to a new branch '<new-branch-name>'

Show branches

Show all branches
git branch
  main
* <branch-name>
Show current branch
git branch --show-current
<branch-name>

Switch to branch

git checkout <branch-name>>
Switched to a new branch '<branch-name>'

Merge

Branch "update" mit "main" mergen
git checkout main       (1)
git merge update        (2)
Branch "update" entfernen
git branch -d update

History

Anzeigen
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"