skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
git-branches
This page is read only. You can view the source, but not change it.
# Git branches **Branches** are pointers to commits. The default branch is usually `main` or `master`. Create a branch to experiment without affecting the main branch, then merge it back when ready. This is how teams work in parallel on different features without conflicts. ```bash $ git branch # list branches $ git branch <name> # create a branch $ git checkout <branch> # switch to a branch $ git switch <branch> # modern way to switch (git 2.23+) $ git branch -d <branch> # delete a branch ``` Each branch is independent—changes on one branch don't affect others until you merge. Branches are cheap to create; the recommended workflow is to create a branch for each feature or bug fix, work on it in isolation, then merge it back to main once it's tested.
Page Tools
Show pagesource
Backlinks
Back to top