You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The legacy command-line terminal on Windows (`cmd.exe`) isn't really capable of a customized Git experience, but if you're using PowerShell, you're in luck.
7
-
This also works if you're running PowerShell on a non-Windows platform like Debian.
8
-
A package called Posh-Git (https://github.com/dahlbyk/posh-git[]) provides powerful tab-completion facilities, as well as an enhanced prompt to help you stay on top of your repository status.
7
+
This also works if you're running PowerShell Core on Linux or macOS.
8
+
A package called posh-git (https://github.com/dahlbyk/posh-git[]) provides powerful tab-completion facilities, as well as an enhanced prompt to help you stay on top of your repository status.
9
9
It looks like this:
10
10
11
11
.PowerShell with Posh-git.
@@ -27,16 +27,15 @@ More about PowerShell ExecutionPolicy: https://docs.microsoft.com/en-us/powershe
27
27
-----
28
28
29
29
===== PowerShell Gallery
30
-
If you have at least PowerShell 5 or PowerShell 4 with PackageManagement installed, you can use the package manager to fetch Posh-Git for you.
30
+
If you have at least PowerShell 5 or PowerShell 4 with PackageManagement installed, you can use the package manager to install posh-git for you.
31
31
32
32
More information about PowerShell Gallery: https://docs.microsoft.com/en-us/powershell/gallery/overview[]
> Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force # Newer beta version with PowerShell Core support
38
37
-----
39
-
If you want to install Posh-Git only for the current user and not globally, use "-Scope CurrentUser" instead.
38
+
If you want to install posh-git for all users, use "-Scope AllUsers" instead and execute the command from an elevated PowerShell console.
40
39
If the second command fails with an error like `Module 'PowerShellGet' was not installed by using Install-Module`, you'll need to run another command first:
41
40
42
41
[source,powershell]
@@ -48,21 +47,23 @@ Then you can go back and try again.
48
47
This happens, because the modules that ship with Windows PowerShell are signed with a different publishment certificate.
49
48
50
49
===== Update PowerShell Prompt
51
-
To include git information in your prompt, posh-git needs to be imported. To do this automatically, include the import statement into you $profile script. This script is executed everytime you open a new PowerShell prompt.
50
+
To include git information in your prompt, the posh-git module needs to be imported. To have posh-git imported every time PowerShell starts, execute the Add-PoshGitToProfile command which will add the import statement into you $profile script. This script is executed everytime you open a new PowerShell console.
52
51
Keep in mind, that there are multiple $profile scripts. E. g. one for the console and a separate one for the ISE.
This will add the proper line to your `profile.ps1` file, and posh-git will be active the next time you open your prompt.
67
+
This will add the proper line to your `profile.ps1` file, and posh-git will be active the next time you open PowerShell.
68
+
For a description of the Git status summary information displayed in the prompt see: https://github.com/dahlbyk/posh-git/blob/master/README.md#git-status-summary-information[]
69
+
For more details on how to customize your posh-git prompt see: https://github.com/dahlbyk/posh-git/blob/master/README.md#customization-variables[]
0 commit comments