Skip to content
This repository
Browse code

Add prompt overview to README. Closes #10

  • Loading branch information...
commit 93766865de62579d3f177a17d1b4a113fb019fa3 1 parent 8e118a4
Keith Dahlby authored

Showing 1 changed file with 43 additions and 0 deletions. Show diff stats Hide diff stats

  1. +43 0 readme.md
43 readme.md
Source Rendered
@@ -33,6 +33,49 @@ Installing
33 33
34 34 5. Enjoy!
35 35
  36 +The Prompt
  37 +----------
  38 +
  39 +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`:
  40 +
  41 + C:\Users\Keith [master]>
  42 +
  43 +By default, the status summary has the following format:
  44 +
  45 + [{HEAD-name} +A ~B -C !D | +E ~F -G !H]
  46 +
  47 +* `{HEAD-name}` is the current branch, or the SHA of a detached HEAD
  48 + * Cyan means the branch matches its remote
  49 + * Green means the branch is ahead of its remote (green light to push)
  50 + * Red means the branch is behind its remote
  51 +* ABCD represent the index; EFGH represent the working directory
  52 + * `+` = Added files
  53 + * `~` = Modified files
  54 + * `-` = Removed files
  55 + * `!` = Conflicted files
  56 + * As in `git status`, index status is dark red and working directory status is dark green
  57 +
  58 +For example, a status of `[master +0 ~2 -1 | +1 ~1 -0]` corresponds to the following `git status`:
  59 +
  60 + # On branch master
  61 + #
  62 + # Changes to be committed:
  63 + # (use "git reset HEAD <file>..." to unstage)
  64 + #
  65 + # modified: this-changed.txt
  66 + # modified: this-too.txt
  67 + # deleted: gone.ps1
  68 + #
  69 + # Changed but not updated:
  70 + # (use "git add <file>..." to update what will be committed)
  71 + # (use "git checkout -- <file>..." to discard changes in working directory)
  72 + #
  73 + # modified: not-staged.ps1
  74 + #
  75 + # Untracked files:
  76 + # (use "git add <file>..." to include in what will be committed)
  77 + #
  78 + # new.file
36 79
37 80 ### Based on work by:
38 81

0 comments on commit 9376686

Please sign in to comment.
Something went wrong with that request. Please try again.