Write slides about merge with conflict

This commit is contained in:
Jonathan Hodgson 2020-06-13 00:07:22 +01:00
parent c6c938207f
commit 1df85219c9
7 changed files with 127 additions and 3 deletions

6
shell/cat-complex-merge Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd /tmp/demo
echo '$ cat greeting.py'
cat greeting.py

20
shell/complex-merge Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
DIR="$(dirname "$(readlink -f "$0")")"
cd /tmp/demo
git switch master > /dev/null
git branch dog > /dev/null
cp "${DIR}/../code-examples/python-cat.py" greeting.py > /dev/null
git add greeting.py > /dev/null
git commit -m "Makes a cat say Meow" > /dev/null
git switch dog > /dev/null
cp "${DIR}/../code-examples/python-dog.py" greeting.py > /dev/null
git add greeting.py > /dev/null
git commit -m "Makes a dog say Woof" > /dev/null
git switch master > /dev/null
echo " # Make changes to 2 branches in the same place #"
echo '$ git switch master'
echo '$ git log --oneline --all --graph'
git -c color.ui=always log --oneline --all --graph --decorate=short
echo '$ git merge dog'
git merge dog --no-edit

14
shell/fix-complex-merge Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
DIR="$(dirname "$(readlink -f "$0")")"
cd /tmp/demo
cp "${DIR}/../code-examples/python-merged.py" greeting.py > /dev/null
echo '$ vim greeting.py'
echo ' # Fix the conflict(s) #'
echo '$ git add greeting.py'
git add greeting.py
echo '$ git commit'
git commit -F .git/COMMIT_EDITMSG
echo '$ git log --oneline --all --graph'
git -c color.ui=always log --oneline --all --graph --decorate=short