Skip to content

Instantly share code, notes, and snippets.

@twolfson
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/8950891 to your computer and use it in GitHub Desktop.
Save twolfson/8950891 to your computer and use it in GitHub Desktop.

Steps to reproduce merged yet clean state

# Clone the repo
git clone https://gist.github.com/8950891.git gist-sexy-bash-prompt-merge-status
cd gist-sexy-bash-prompt-merge-status/

# On a new branch, make a commit
git checkout -b dev/ahead.a
echo "Goodbye Moon" > a.txt
git add -A
git commit -m "Saying goodbye moon"

# On another branch, make a conflicting commit
git checkout master
git checkout -b dev/ahead.b
echo "Goodbye Sun" > a.txt
git add -A
git commit -m "Saying goodbye sun"

# Move to a conflict resolution branch (unnecessary)
git checkout -b dev/conflict

# Introduce our conflict and resolve with HEAD
git merge dev/ahead.a
git checkout HEAD -- a.txt

# We are in merge conflict state but porcelain is empty
git status
git status --porcelain
echo $?
Hello World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment