Skip to content

Commit

Permalink
Add prompt overview to README. Closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Dec 20, 2011
1 parent 8e118a4 commit 9376686
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions readme.md
Expand Up @@ -33,6 +33,49 @@ Installing

5. Enjoy!

The Prompt
----------

PowerShell generates its prompt by executing a `prompt` function, if one exists. posh-git defines such a function in `profile.example.ps1` that outputs the current working directory followed by an abbreviated `git status`:

C:\Users\Keith [master]>

By default, the status summary has the following format:

[{HEAD-name} +A ~B -C !D | +E ~F -G !H]

* `{HEAD-name}` is the current branch, or the SHA of a detached HEAD
* Cyan means the branch matches its remote
* Green means the branch is ahead of its remote (green light to push)
* Red means the branch is behind its remote
* ABCD represent the index; EFGH represent the working directory
* `+` = Added files
* `~` = Modified files
* `-` = Removed files
* `!` = Conflicted files
* As in `git status`, index status is dark red and working directory status is dark green

For example, a status of `[master +0 ~2 -1 | +1 ~1 -0]` corresponds to the following `git status`:

# On branch master
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: this-changed.txt
# modified: this-too.txt
# deleted: gone.ps1
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: not-staged.ps1
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# new.file

### Based on work by:

Expand Down

0 comments on commit 9376686

Please sign in to comment.