Branches
Create and list branches
Section titled “Create and list branches”git branch # list branchesgit branch new-branch # create a new branch
Switch branches
Section titled “Switch branches”git checkout new-branch# or (new syntax)git switch new-branch
Merge a branch
Section titled “Merge a branch”git merge new-branch
Best practices
Section titled “Best practices”- Use clear names (
feature/login
,bugfix/header
). - Delete branches that are no longer needed with
git branch -d
. - Always test before merging.