diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-04-08 14:58:53 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-04-08 14:58:53 +0200 |
commit | d8bf7d416f60f52335d128cf16fbba0344702e49 (patch) | |
tree | ea7fe64eaad283fef80429f97c6a5cf3a51035e5 /doc | |
parent | a08733d76a8254a20a28f4c3875a173dcf0ad129 (diff) | |
parent | 6cc1e7e08094494916db1aadda17e03ce695d049 (diff) | |
download | gitpython-d8bf7d416f60f52335d128cf16fbba0344702e49.tar.gz |
Merge branch 'teeberg-master'
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/tutorial.rst | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 0d60f0aa..84b3b5f5 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -331,12 +331,17 @@ You can easily access configuration information for a remote by accessing option :start-after: # [26-test_references_and_objects] :end-before: # ![26-test_references_and_objects] -You can also specify per-call custom environments using a new context manager on the Git command +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*. -.. literalinclude:: ../../git/test/test_docs.py - :language: python - :start-after: # [32-test_references_and_objects] - :end-before: # ![32-test_references_and_objects] + ssh_cmd = 'ssh -i id_deployment_key' + with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd): + repo.remotes.origin.fetch() + +This one sets a custom script to be executed in place of `ssh`, and can be used in `git` prior to *v2.3*. + + ssh_executable = os.path.join(rw_dir, 'my_ssh_executable.sh') + with repo.git.custom_environment(GIT_SSH=ssh_executable): + repo.remotes.origin.fetch() Submodule Handling ****************** |