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
If it is not available, you can download it at address https://pypi.python.org/pypi/fastimport/.
56
57
57
58
In the second case (on Windows), `bzr-fastimport` is automatically installed with the standalone version and the default installation (let all the checkboxes checked).
Copy file name to clipboardExpand all lines: book/A-git-in-other-environments/sections/bash.asc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ First, you need to get a copy of the `contrib/completion/git-completion.bash` fi
8
8
Copy it somewhere handy, like your home directory, and add this to your `.bashrc`:
9
9
10
10
[source,console]
11
-
-----
11
+
----
12
12
. ~/git-completion.bash
13
-
-----
13
+
----
14
14
15
15
Once that's done, change your directory to a Git repository, and type:
16
16
@@ -27,11 +27,11 @@ This can be as simple or complex as you want, but there are generally a few key
27
27
To add these to your prompt, just copy the `contrib/completion/git-prompt.sh` file from Git's source repository to your home directory, add something like this to your `.bashrc`:
28
28
29
29
[source,console]
30
-
-----
30
+
----
31
31
. ~/git-prompt.sh
32
32
export GIT_PS1_SHOWDIRTYSTATE=1
33
33
export PS1='\w$(__git_ps1 " (%s)")\$ '
34
-
-----
34
+
----
35
35
36
36
The `\w` means print the current working directory, the `\$` prints the `$` part of the prompt, and `__git_ps1 " (%s)"` calls the function provided by `git-prompt.sh` with a formatting argument.
37
37
Now your bash prompt will look like this when you're anywhere inside a Git-controlled project:
Copy file name to clipboardExpand all lines: book/A-git-in-other-environments/sections/powershell.asc
+30-18Lines changed: 30 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,32 +12,39 @@ It looks like this:
12
12
image::images/posh-git.png[PowerShell with Posh-git.]
13
13
14
14
==== Installation
15
+
15
16
===== Prerequisites (Windows only)
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).
17
-
If you choose AllSigned instead of RemoteSigned, also local scripts (your own) need to be digitally signed in order to be executed.
18
-
With RemoteSigned, only Scripts having the "ZoneIdentifier" set to Internet (were downloaded from the web) need to be signed, others not.
19
-
If you're an administrator and want to set it for all Users on that machine, use "-Scope LocalMachine".
20
-
If you're a normal user, without administrative rights, you can use "-Scope CurrentUser" to set it only for you.
17
+
18
+
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`).
19
+
If you choose `AllSigned` instead of `RemoteSigned`, also local scripts (your own) need to be digitally signed in order to be executed.
20
+
With `RemoteSigned`, only scripts having the `ZoneIdentifier` set to `Internet` (were downloaded from the web) need to be signed, others not.
21
+
If you're an administrator and want to set it for all users on that machine, use `-Scope LocalMachine`.
22
+
If you're a normal user, without administrative rights, you can use `-Scope CurrentUser` to set it only for you.
21
23
22
24
More about PowerShell Scopes: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes[]
23
25
24
26
More about PowerShell ExecutionPolicy: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy[]
25
27
28
+
To set the value of `ExecutionPolicy` to `RemoteSigned` for all users use the next command:
> Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force # Newer beta version with PowerShell Core support
39
-
-----
40
-
If you want to install posh-git for all users, use "-Scope AllUsers" instead and execute the command from an elevated PowerShell console.
45
+
----
46
+
47
+
If you want to install posh-git for all users, use `-Scope AllUsers` instead and execute the command from an elevated PowerShell console.
41
48
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:
42
49
43
50
[source,powershell]
@@ -49,26 +56,31 @@ Then you can go back and try again.
49
56
This happens, because the modules that ship with Windows PowerShell are signed with a different publishment certificate.
50
57
51
58
===== Update PowerShell Prompt
59
+
52
60
To include git information in your prompt, the posh-git module needs to be imported.
53
-
To have posh-git imported every time PowerShell starts, execute the Add-PoshGitToProfile command which will add the import statement into you $profile script.
61
+
To have posh-git imported every time PowerShell starts, execute the `Add-PoshGitToProfile` command which will add the import statement into your `$profile` script.
54
62
This script is executed everytime you open a new PowerShell console.
55
-
Keep in mind, that there are multiple $profile scripts.
63
+
Keep in mind, that there are multiple `$profile` scripts.
56
64
E. g. one for the console and a separate one for the ISE.
65
+
57
66
[source,powershell]
58
-
-----
67
+
----
59
68
> Import-Module posh-git
60
69
> Add-PoshGitToProfile -AllHosts
61
-
-----
70
+
----
62
71
63
72
===== From Source
64
-
Just download a posh-git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it.
65
-
Then import the module using the full path to the posh-git.psd1 file:
73
+
74
+
Just download a posh-git release from https://github.com/dahlbyk/posh-git/releases[], and uncompress it.
75
+
Then import the module using the full path to the `posh-git.psd1` file:
This will add the proper line to your `profile.ps1` file, and posh-git will be active the next time you open PowerShell.
84
+
73
85
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[]
74
86
For more details on how to customize your posh-git prompt see: https://github.com/dahlbyk/posh-git/blob/master/README.md#customization-variables[]
For more information on vcs_info, check out its documentation
44
-
in the `zshcontrib(1)` manual page,
45
-
or online at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[].
43
+
For more information on `vcs_info`, check out its documentation in the `zshcontrib(1)` manual page, or online at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[].
46
44
47
-
Instead of vcs_info, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] for details.
45
+
Instead of `vcs_info`, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] for details.
48
46
`git-prompt.sh` is compatible with both Bash and Zsh.
49
47
50
48
Zsh is powerful enough that there are entire frameworks dedicated to making it better.
@@ -53,5 +51,5 @@ oh-my-zsh's plugin system comes with powerful git tab-completion, and it has a v
53
51
<<oh_my_zsh_git>> is just one example of what can be done with this system.
54
52
55
53
[[oh_my_zsh_git]]
56
-
.An example of an oh-my-zsh theme.
54
+
.An example of an oh-my-zsh theme
57
55
image::images/zsh-oh-my.png[An example of an oh-my-zsh theme.]
Pluggable storage provides many interesting options.
56
54
For instance, https://github.com/go-git/go-git/tree/master/_examples/storage[] allows you to store references, objects, and configuration in an Aerospike database.
@@ -61,24 +59,23 @@ Using https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem[] it i
61
59
Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[].
62
60
63
61
[source, go]
64
-
-----
62
+
----
65
63
customClient := &http.Client{
66
-
Transport: &http.Transport{ // accept any certificate (might be useful for testing)
0 commit comments