update demo instructions
parent
7f8afce0aa
commit
0808130c9e
@ -1,14 +1,47 @@
|
|||||||
# DEMO: Git Conflict
|
# DEMO: Git Conflict
|
||||||
|
|
||||||
1) Pull the repository
|
Before the demo:
|
||||||
2) Checkout to a feature branch
|
|
||||||
3) Make changes
|
```
|
||||||
4) Checkout to main
|
cp -r src\ git-conflict-demo-repo
|
||||||
5) Checkout to another feature branch
|
cd git-conflict-demo-repo\
|
||||||
6) Make conflicting changes
|
git init
|
||||||
7) Merge the changes
|
git checkout -b main
|
||||||
8) Checkout to main
|
git add calculator.ts
|
||||||
|
git commit -m "initial commit"
|
||||||
9) Checkout to first feature branch
|
```
|
||||||
10) Merge the changes
|
|
||||||
11) Resolve conflict
|
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
|
Loading…
Reference in New Issue