Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6cc1e7e

Browse files
committed
docs(tutorial): add pre-v2.3 GIT_SSH example
It goes along with the new one advertising the GIT_SSH_COMMANDenvironment variable.Related togitpython-developers#256
1 parent158bc98 commit6cc1e7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎doc/source/tutorial.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,17 @@ You can easily access configuration information for a remote by accessing option
331331
:start-after: # [26-test_references_and_objects]
332332
:end-before: # ![26-test_references_and_objects]
333333

334-
You can also specify per-call custom environments using a new context manager on the Git command, e.g. for using a specific SSH key.
334+
You can also specify per-call custom environments using a new context manager on the Git command, e.g. for using a specific SSH key. The following example works with `git` starting at *v2.3*.
335335

336336
ssh_cmd = 'ssh -i id_deployment_key'
337337
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
338338
repo.remotes.origin.fetch()
339+
340+
This one sets a custom script to be executed in place of `ssh`, and can be used in `git` prior to *v2.3*.
341+
342+
ssh_executable = os.path.join(rw_dir, 'my_ssh_executable.sh')
343+
with repo.git.custom_environment(GIT_SSH=ssh_executable):
344+
repo.remotes.origin.fetch()
339345

340346
Submodule Handling
341347
******************

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp