Created
August 24, 2015 06:17
-
-
Save mvines/6c94023513275c096bd9 to your computer and use it in GitHub Desktop.
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 -ex | |
add() { | |
local i=$1 | |
echo $i > $i | |
git add $i | |
git commit -m "Add $i" | |
} | |
cd $(dirname $0) | |
rm -rf .git | |
git init . | |
git commit --allow-empty -m "Initial commit" | |
for i in a b c; do | |
add $i | |
done | |
echo d >> c | |
git add c | |
git commit -m "Add d to c" | |
git branch milestone | |
git checkout milestone | |
add ma | |
add mb | |
git checkout master | |
add d | |
add e | |
git merge milestone -m "Merge back to master" --no-ff --stat | |
add f | |
add g | |
git checkout milestone | |
git revert -n HEAD~2 | |
git commit -m "Revert add d to c" | |
git rm b | |
git commit -m "bye b" | |
git checkout master | |
git merge milestone -s ours -m "Ignore 'Revert add d to c'" | |
add h | |
add i | |
git checkout milestone | |
add mc | |
add md | |
git checkout master | |
git merge milestone -m "Merge back to master" --no-ff --stat | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment