Skip to content

Instantly share code, notes, and snippets.

@l0b0
Created July 31, 2012 14:38
Show Gist options
  • Save l0b0/3217470 to your computer and use it in GitHub Desktop.
Save l0b0/3217470 to your computer and use it in GitHub Desktop.

Revisions

  1. l0b0 renamed this gist Jul 31, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. l0b0 created this gist Jul 31, 2012.
    63 changes: 63 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,63 @@
    #!/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