Skip to content

Instantly share code, notes, and snippets.

@meonkeys
Created August 10, 2011 16:45
Show Gist options
  • Save meonkeys/1137368 to your computer and use it in GitHub Desktop.
Save meonkeys/1137368 to your computer and use it in GitHub Desktop.
demonstrate git stash conflict
#!/bin/bash
tmpdir=`mktemp -d`
echo creating new repo in $tmpdir
set -x
cd $tmpdir
git init
echo -e 'blah\nfoo\nbar' > a
echo -e 'hello world' > b
git add a b
git commit -am 'first'
echo -e 'blah\npoop\nbar' > a
echo -e 'goodbye world' > b
git stash
echo -e 'blah\npee\nbar' > a
git commit -am 'changes in file a will conflict with stash'
git stash pop
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment