D2 - branching and merging
branches
branches
- pointers to a specific commits
git branch {branch name}
- makes it easy to divide up work than work
- checking out puts on the selected branch
git checkout {branch name}
- to create a new branch and checkout:
git checkout -b {branch name}
branch off and merge
- users can branch off from the
mainbranch, eg. to add various features on afeaturebranch - this can later be combined or merged

image: learn git branching
- to merge
bugFixintomainwhen theHEADismain:
git merge bugFix
branch forcing
- directly reassigning branch to a commit
- to move (by force) main to three parent branches behind head:
git branch -f main HEAD~3