Created
July 31, 2012 14:38
-
-
Save l0b0/3217470 to your computer and use it in GitHub Desktop.
Simple merge example
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
#!/usr/bin/env bash | |
set -o errexit -o nounset -o pipefail | |
cd "$(mktemp --directory)" | |
git init | |
cat > test.txt <<EOF | |
alfa | |
bravo | |
charlie | |
delta | |
echo | |
foxtrot | |
golf | |
hotel | |
india | |
juliet | |
kilo | |
lima | |
mike | |
november | |
oscar | |
papa | |
quebec | |
romeo | |
sierra | |
tango | |
uniform | |
victor | |
whiskey | |
x-ray | |
yankee | |
zulu | |
EOF | |
git add test.txt | |
git commit --message "Initial commit" | |
git branch --track experiment | |
git checkout experiment | |
sed --in-place --expression 's/alfa/abraham/' test.txt | |
git commit --all --message "Experiment successful" | |
cat >> test.txt <<EOF | |
one | |
two | |
three | |
four | |
five | |
six | |
seven | |
eight | |
nine | |
EOF | |
git commit --all --message "Added numbers" | |
git checkout master | |
sed --in-place --expression 's/alfa/alpha/' test.txt | |
cat >> test.txt <<EOF | |
ærlig | |
østen | |
åse | |
EOF | |
git commit --all --message "Norwegian" | |
git rebase experiment || git mergetool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment