Kjell

Git Branches

Branching

Use branches to:

Default branch

git config --global init.defaultBranch main

Creating a branch

git branch "branch-name"
git branch

Switching branches

git checkout "branch-name"
git switch "branch-name"

Deleting branches

git branch "branch-name" -D

Merge

Undo commit: revert

git revert HEAD
git revert "sha"

.gitignore