Last active
December 13, 2017 16:31
-
-
Save Andrew8xx8/58319104b9b17e136f0ce7bbdabad1c6 to your computer and use it in GitHub Desktop.
Git merge fuckup
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
git init | |
touch correct.txt broken.txt | |
git add . | |
git commit -m "Init commit" | |
git checkout -b feature | |
echo 'I need to be here!' >> correct.txt | |
echo 'I need to be here!' >> broken.txt | |
git add . | |
git commit -m "Texts added" | |
git checkout master | |
git merge feature | |
cat correct.txt | |
cat broken.txt | |
git log --oneline | |
git checkout feature | |
g co HEAD~1 broken.txt | |
git add . | |
git commit --amend | |
cat broken.txt | |
git checkout master | |
git merge feature | |
cat correct.txt | |
cat broken.txt | |
git co feature | |
cat correct.txt | |
cat broken.txt | |
git checkout master | |
git log --oneline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment