Skip to content

Instantly share code, notes, and snippets.

@samuelspiza
Created March 2, 2010 21:29
Show Gist options
  • Save samuelspiza/319971 to your computer and use it in GitHub Desktop.
Save samuelspiza/319971 to your computer and use it in GitHub Desktop.
Creating a git repo with a merge conflict for testing purposes.
#!/bin/sh
# Creating a git repo with a merge conflict for testing purposes.
mkdir merge
cd merge
git init
echo "BASE" > conflict.txt
git add conflict.txt
git commit -m "Initial commit"
git checkout -b br
echo "REMOTE" > conflict.txt
git commit -a -m "br commit"
git checkout master
echo "LOCAL" > conflict.txt
git commit -a -m "master commit"
git merge br
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment