Created
November 28, 2013 16:57
-
-
Save chalstrick/7694959 to your computer and use it in GitHub Desktop.
shell script to show how native git handles certain file/folder conflicts during checkout
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/sh | |
set -x | |
# create the setup: first commit has x/y and second commit only x | |
git init | |
mkdir x | |
echo foo > x/y | |
git add x/y | |
git commit -m "add x/y" | |
git tag H | |
git rm -r x | |
echo bar > x | |
git add x | |
git commit -m "add x" | |
git tag M | |
# test5 | |
git reset --hard H | |
git rm -r x | |
echo bar > x | |
git add x | |
git checkout M | |
git status | |
# test5b | |
git checkout master | |
git reset --hard H | |
git rm -r x | |
echo anotherBar > x | |
git add x | |
git checkout M | |
git status | |
# test6 | |
git checkout master | |
git reset --hard H | |
git rm -r x | |
echo bar > x | |
git add x | |
echo anotherBar > x | |
git checkout M | |
git status | |
# test6b | |
git checkout master | |
git reset --hard H | |
git rm -r x | |
echo anotherBar > x | |
git add x | |
echo differentBar > x | |
git checkout M | |
git status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment