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
Copy file name to clipboardExpand all lines: book/A-git-in-other-environments/sections/guis.asc
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,6 @@ Then you can simply stage or unstage some changes, alter the commit message, and
66
66
`gitk` and `git-gui` are examples of task-oriented tools.
67
67
Each of them is tailored for a specific purpose (viewing history and creating commits, respectively), and omit the features not necessary for that task.
The standard 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.
6
+
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.
7
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.
8
9
It looks like this:
9
10
10
11
.Powershell with Posh-git.
11
12
image::images/posh-git.png[Powershell with Posh-git.]
12
13
13
14
==== Installation
14
-
===== Prerequisites
15
+
===== Prerequisites (Windows only)
15
16
Before you're able to run PowerShell scripts on your machine, you need to set your local ExecutionPolicy to RemoteSigned (Basically anything except Undefined and Restricted). If you choose AllSigned instead of RemoteSigned, also local scripts (your own) need to be digitally signed in order to be executed. With RemoteSigned, only Scripts having the "ZoneIdentifier" set to Internet (were downloaded from the web) need to be signed, others not.
16
17
If you're an administrator and want to set it for all Users on that machine, use "-Scope LocalMachine".
17
18
If you're a normal user, without administrative rights, you can use "-Scope CurrentUser" to set it only for you.
@@ -28,16 +29,27 @@ If you have at least PowerShell 5 or PowerShell 4 with PackageManagement install
28
29
More information about the requirements: (https://docs.microsoft.com/en-us/powershell/gallery/psget/get_psget_module[])
If you want to install Posh-Git only for the currnet user and not globaly, use "-Scope CurrentUser" instead.
36
+
If you want to install Posh-Git only for the current user and not globally, use "-Scope CurrentUser" instead.
37
+
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:
This happens, because the modules that ship with Windows Powershell are signed with a different publishment certificate.
35
46
36
47
===== Update PowerShell Prompt
37
48
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.
38
49
Keep in mind, that there are multiple $profile scripts. E. g. one for the console and a separate one for the ISE.
0 commit comments