Skip to content

Instantly share code, notes, and snippets.

@Andrew8xx8 Andrew8xx8/gmf.sh
Last active Dec 13, 2017

Embed
What would you like to do?
Git merge fuckup
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.