diff --git a/README.md b/README.md index eca808c..7aa6593 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,47 @@ # DEMO: Git Conflict -1) Pull the repository -2) Checkout to a feature branch -3) Make changes -4) Checkout to main -5) Checkout to another feature branch -6) Make conflicting changes -7) Merge the changes -8) Checkout to main - -9) Checkout to first feature branch -10) Merge the changes -11) Resolve conflict \ No newline at end of file +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``` +1) Checkout to branch +```git checkout fix-multiplication``` +1) Fix the multiplication function +1) Add & Commit changes +```git add calculator.ts``` +```git commit -m "fix multiplication"``` +1) Note that we did not merge the changes yet, they are in the feature branch +1) Checkout to main +```git checkout main``` + + +1) Checkout to another feature branch +```git branch fix-calculator``` +1) Make conflicting changes +1) Add & Commit changes +```git add calculator.ts``` +```git commit -m "fix calculator"``` +1) Checkout to main +```git checkout main``` +1) Merge the changes +```git merge fix-calculator``` + +1) Try to merge the changes from the first branch +```git merge fix-multiplication``` +1) Observe the conflict message +1) Fix the source code +1) Add & Commit the changes +```git commit -am "fix merge conflict"``` +1) Observe the finished product \ No newline at end of file