Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (62 sloc) 3.473 kb
53894c4 Keith Dahlby 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.
8
9 ### Tab completion
10 Provides tab completion for common commands when using git.
11 E.g. `git ch<tab>` --> `git checkout`
12
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 Eric Lee Updated the readme with a note about performance and disabling file stat...
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
53894c4 Keith Dahlby Convert readme to Markdown
authored
21 Installing
22 ----------
23
18d60df Keith Dahlby Update readme
authored
24 0. Verify you have PowerShell 2.0 or better with $PSVersionTable.PSVersion
5087d6b Keith Dahlby Add note about PowerShell 2.0 dependency
authored
25
a6606ea Keith Dahlby Update readme.md
authored
26 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 Keith Dahlby Convert readme to Markdown
authored
27
28 2. Verify that `git` can be run from PowerShell. If the command is not found, you will need to add a git alias or add `%ProgramFiles%\Git\cmd` to your PATH environment variable.
29
30 3. Clone the posh-git repository to your local machine.
31
32 4. From the posh-git repository directory, run `.\install.ps1`.
33
34 5. Enjoy!
35
9376686 Keith Dahlby Add prompt overview to README. Closes #10
authored
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
e940ca5 Keith Dahlby Update readme for ahead/behind branch color
authored
51 * Yellow means the branch is both ahead of and behind its remote
9376686 Keith Dahlby Add prompt overview to README. Closes #10
authored
52 * ABCD represent the index; EFGH represent the working directory
53 * `+` = Added files
54 * `~` = Modified files
55 * `-` = Removed files
56 * `!` = Conflicted files
57 * As in `git status`, index status is dark red and working directory status is dark green
58
59 For example, a status of `[master +0 ~2 -1 | +1 ~1 -0]` corresponds to the following `git status`:
60
61 # On branch master
62 #
63 # Changes to be committed:
64 # (use "git reset HEAD <file>..." to unstage)
65 #
66 # modified: this-changed.txt
67 # modified: this-too.txt
68 # deleted: gone.ps1
69 #
70 # Changed but not updated:
71 # (use "git add <file>..." to update what will be committed)
72 # (use "git checkout -- <file>..." to discard changes in working directory)
73 #
74 # modified: not-staged.ps1
75 #
76 # Untracked files:
77 # (use "git add <file>..." to include in what will be committed)
78 #
79 # new.file
53894c4 Keith Dahlby Convert readme to Markdown
authored
80
81 ### Based on work by:
82
83 - Keith Dahlby, http://solutionizing.net/
84 - Mark Embling, http://www.markembling.info/
85 - Jeremy Skinner, http://www.jeremyskinner.co.uk/
Something went wrong with that request. Please try again.