concepts
how to practice
Setup merge commits into feature branch
- create a new branch
test-rebase
- add a few arbitrary commits to
test-rebase
- switch to
main and add commits there
- switch to
test-rebase and merge main into test-rebase: $ git checkout test-rebase; git merge main
- add few more arbitrary commits to
test-rebase
- use
git rebase -i to clean up test-rebase
Use rebase to bring changes from main into a feature branch (assuming origin is your fork and upstream is the upstream repo)
git fetch upstream
git checkout feature-branch
git rebase upstream/main - resolve conflicts if any
concepts
how to practice
Setup merge commits into feature branch
test-rebasetest-rebasemainand add commits theretest-rebaseand mergemainintotest-rebase:$ git checkout test-rebase; git merge maintest-rebasegit rebase -ito clean uptest-rebaseUse rebase to bring changes from main into a feature branch (assuming
originis your fork andupstreamis the upstream repo)git fetch upstreamgit checkout feature-branchgit rebase upstream/main- resolve conflicts if any