Created
March 20, 2020 00:39
-
-
Save mattneub/46b193eed0089f0870386400e52ab19a to your computer and use it in GitHub Desktop.
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
git init foo | |
cd foo | |
touch this that | |
git add . | |
git commit -m '1 master' | |
git checkout -b feature | |
echo 'feature' > this | |
git commit -a -m '1 feature' | |
git checkout master | |
echo 'master' > that | |
git commit -a -m '2 master' | |
git merge -m 'Merge feature' feature | |
echo 'master 2' >> that | |
git commit -a -m '3 master after merge' | |
# but now... | |
echo 'feature 2' >> this | |
git commit -a -m '4 master two after merge' | |
cat this that | |
# feature | |
# feature 2 | |
# master | |
# master 2 | |
git rebase -i HEAD^^^^ | |
# remove feature 1 | |
# CONFLICT (content): Merge conflict in this | |
# so we edit this: | |
# <<<<<<< HEAD | |
# ======= | |
# feature | |
# feature 2 | |
# >>>>>>> c84fea8... 4 master two after merge | |
# what to do? well, we _might_ wish to keep the content | |
# let's do that | |
git add this | |
git rebase --continue | |
cat this that | |
# feature | |
# feature 2 | |
# master | |
# master 2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment