Created
October 5, 2017 06:40
-
-
Save snoblenet/6567d94aff189255c6eb300753c5e796 to your computer and use it in GitHub Desktop.
Instant Git Merge Practice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm my-code.txt > /dev/null 2>&1 & | |
rm -rf .git > /dev/null 2>&1 & | |
touch my-code.txt | |
git init | |
git add my-code.txt | |
echo ' --------------------------- ' > my-code.txt | |
echo ' fruit, computer or colours? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' apple ' >> my-code.txt | |
echo ' orange ' >> my-code.txt | |
echo ' pear ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' right, wrong, left or kept? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' right ' >> my-code.txt | |
echo ' left ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
git commit -am 'initial commit' | |
git checkout -b feature-branch | |
echo ' --------------------------- ' > my-code.txt | |
echo ' fruit, computer or colours? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' apple ' >> my-code.txt | |
echo ' dell ' >> my-code.txt | |
echo ' hp ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' right, wrong, left or kept? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' right ' >> my-code.txt | |
echo ' wrong ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
git commit -am 'wrong not left; dell not orange' | |
git checkout master | |
echo ' --------------------------- ' > my-code.txt | |
echo ' fruit, computer or colours? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' blue ' >> my-code.txt | |
echo ' orange ' >> my-code.txt | |
echo ' green ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' right, wrong, left or kept? ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' kept ' >> my-code.txt | |
echo ' left ' >> my-code.txt | |
echo ' ' >> my-code.txt | |
echo ' --------------------------- ' >> my-code.txt | |
git commit -am 'second commit on master' | |
git merge feature-branch | |
git mergetool my-code.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use:
chmod +x conflicted.sh
)./conflicted.sh
)./conflicted.sh
) for more practice