Created
June 24, 2015 09:05
-
-
Save JonathanMH/397fc427842614dd4803 to your computer and use it in GitHub Desktop.
Create a merge conflict in git
This file contains 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 | |
mkdir git-repo | |
cd git-repo | |
git init | |
touch my_code.sh | |
git add my_code.sh | |
echo "echo Hello" > my_code.sh | |
git commit -am 'initial' | |
git checkout -b new_branch | |
echo "echo \"Hello World\"" > my_code.sh | |
git commit -am 'first commit on new_branch' | |
git checkout master | |
echo "echo \"Hello World!\"" > my_code.sh | |
git commit -am 'second commit on master' | |
git merge new_branch |
I think in modern git default branch is main
not master
, line 12 now potentialy generate error.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful for testing my mergetool environment! Thanks!