Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 98 lines (71 sloc) 3.815 kB
53894c4 @dahlbyk Convert readme to Markdown
authored
1 posh-git
2 ========
3
4 A set of PowerShell scripts which provide Git/PowerShell integration
5
6 ### Prompt for Git repositories
7 The prompt within Git repositories can show the current branch and the state of files (additions, modifications, deletions) within.
1440252 @theaquamarine Update readme.md to reflect PS 2.0 deprecation
theaquamarine authored
8
53894c4 @dahlbyk Convert readme to Markdown
authored
9 ### Tab completion
1440252 @theaquamarine Update readme.md to reflect PS 2.0 deprecation
theaquamarine authored
10 Provides tab completion for common commands when using git.
53894c4 @dahlbyk Convert readme to Markdown
authored
11 E.g. `git ch<tab>` --> `git checkout`
1440252 @theaquamarine Update readme.md to reflect PS 2.0 deprecation
theaquamarine authored
12
53894c4 @dahlbyk Convert readme to Markdown
authored
13 Usage
14 -----
15
16 See `profile.example.ps1` as to how you can integrate the tab completion and/or git prompt into your own profile.
17 Prompt formatting, among other things, can be customized using `$GitPromptSettings`, `$GitTabSettings` and `$TortoiseGitSettings`.
18
c1d0e56 @SaintGimp Updated the readme with a note about performance and disabling file s…
SaintGimp authored
19 Note on performance: displaying file status in the git prompt for a very large repo can be prohibitively slow. Rather than turn off file status entirely, you can disable it on a repo-by-repo basis by adding individual repository paths to $GitPromptSettings.RepositoriesInWhichToDisableFileStatus.
20
05fcc61 @vorou Updated readme with installing via PsGet
vorou authored
21 Installing via PsGet
22 --------------------
23
24 If you have [PsGet](http://psget.net/) installed just run:
25
26 ```
27 Install-Module posh-git
28 ```
29
30 Installing (manual)
31 -------------------
53894c4 @dahlbyk Convert readme to Markdown
authored
32
1440252 @theaquamarine Update readme.md to reflect PS 2.0 deprecation
theaquamarine authored
33 0. Verify you have PowerShell 2.0 or better with `$PSVersionTable.PSVersion`. PowerShell 3.0 is preferred as 2.0 support is deprecated.
5087d6b @dahlbyk Add note about PowerShell 2.0 dependency
authored
34
a6606ea @dahlbyk Update readme.md
authored
35 1. Verify execution of scripts is allowed with `Get-ExecutionPolicy` (should be `RemoteSigned` or `Unrestricted`). If scripts are not enabled, run PowerShell as Administrator and call `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm`.
53894c4 @dahlbyk Convert readme to Markdown
authored
36
36d072f @dahlbyk Update readme to assume devs are on 64-bit Windows
authored
37 2. Verify that `git` can be run from PowerShell.
38 If the command is not found, you will need to add a git alias or add `%ProgramFiles(x86)%\Git\cmd`
6686a52 @JayBazuzi Update readme.me formatting
JayBazuzi authored
39 (or `%ProgramFiles%\Git\cmd` if you're still on 32-bit) to your `PATH` environment variable.
53894c4 @dahlbyk Convert readme to Markdown
authored
40
41 3. Clone the posh-git repository to your local machine.
42
43 4. From the posh-git repository directory, run `.\install.ps1`.
44
45 5. Enjoy!
46
9376686 @dahlbyk Add prompt overview to README. Closes #10
authored
47 The Prompt
48 ----------
49
50 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`:
51
52 C:\Users\Keith [master]>
53
54 By default, the status summary has the following format:
55
c481e5b @vorou Info about trailing exclamation mark
vorou authored
56 [{HEAD-name} +A ~B -C !D | +E ~F -G !H !]
9376686 @dahlbyk Add prompt overview to README. Closes #10
authored
57
58 * `{HEAD-name}` is the current branch, or the SHA of a detached HEAD
59 * Cyan means the branch matches its remote
60 * Green means the branch is ahead of its remote (green light to push)
61 * Red means the branch is behind its remote
e940ca5 @dahlbyk Update readme for ahead/behind branch color
authored
62 * Yellow means the branch is both ahead of and behind its remote
9376686 @dahlbyk Add prompt overview to README. Closes #10
authored
63 * ABCD represent the index; EFGH represent the working directory
64 * `+` = Added files
65 * `~` = Modified files
66 * `-` = Removed files
67 * `!` = Conflicted files
b45f39b @dahlbyk Update readme.md
authored
68 * As in `git status`, index status is dark green and working directory status is dark red
c481e5b @vorou Info about trailing exclamation mark
vorou authored
69 * The trailing `!` means there are untracked files
9376686 @dahlbyk Add prompt overview to README. Closes #10
authored
70
71 For example, a status of `[master +0 ~2 -1 | +1 ~1 -0]` corresponds to the following `git status`:
72
73 # On branch master
74 #
75 # Changes to be committed:
76 # (use "git reset HEAD <file>..." to unstage)
77 #
78 # modified: this-changed.txt
79 # modified: this-too.txt
80 # deleted: gone.ps1
81 #
82 # Changed but not updated:
83 # (use "git add <file>..." to update what will be committed)
84 # (use "git checkout -- <file>..." to discard changes in working directory)
85 #
86 # modified: not-staged.ps1
87 #
88 # Untracked files:
89 # (use "git add <file>..." to include in what will be committed)
90 #
91 # new.file
53894c4 @dahlbyk Convert readme to Markdown
authored
92
93 ### Based on work by:
94
95 - Keith Dahlby, http://solutionizing.net/
96 - Mark Embling, http://www.markembling.info/
97 - Jeremy Skinner, http://www.jeremyskinner.co.uk/
Something went wrong with that request. Please try again.