You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.1 KiB

DEMO: Git Conflict

Before the demo:

cp -r src\ git-conflict-demo-repo
cd git-conflict-demo-repo\
git init
git checkout -b main
git add calculator.ts
git commit -m "initial commit"

During the demo:

  1. Create a feature branch git branch fix-multiplication

  2. Checkout to branch git checkout fix-multiplication

  3. Fix the multiplication function

  4. Add & Commit changes git add calculator.ts git commit -m "fix multiplication"

  5. Note that we did not merge the changes yet, they are in the feature branch

  6. Checkout to main git checkout main

  7. Checkout to another feature branch git branch fix-calculator

  8. Make conflicting changes

  9. Add & Commit changes git add calculator.ts git commit -m "fix calculator"

  10. Checkout to main git checkout main

  11. Merge the changes git merge fix-calculator

  12. Try to merge the changes from the first branch git merge fix-multiplication

  13. Observe the conflict message

  14. Fix the source code

  15. Add & Commit the changes git commit -am "fix merge conflict"

  16. Observe the finished product