+26
-15
lines changedFilter options
+26
-15
lines changed Original file line number Diff line number Diff line change
@@ -881,19 +881,21 @@ other
881
881
and the `core.editor` option in linkgit:git-config[1].
882
882
883
883
'GIT_SSH'::
884
-
If this environment variable is set then 'git fetch'
885
-
and 'git push' will use this command instead
886
-
of 'ssh' when they need to connect to a remote system.
887
-
The '$GIT_SSH' command will be given exactly two or
888
-
four arguments: the 'username@host' (or just 'host')
889
-
from the URL and the shell command to execute on that
890
-
remote system, optionally preceded by '-p' (literally) and
891
-
the 'port' from the URL when it specifies something other
892
-
than the default SSH port.
884
+
'GIT_SSH_COMMAND'::
885
+
If either of these environment variables is set then 'git fetch'
886
+
and 'git push' will use the specified command instead of 'ssh'
887
+
when they need to connect to a remote system.
888
+
The command will be given exactly two or four arguments: the
889
+
'username@host' (or just 'host') from the URL and the shell
890
+
command to execute on that remote system, optionally preceded by
891
+
'-p' (literally) and the 'port' from the URL when it specifies
892
+
something other than the default SSH port.
893
893
+
894
-
To pass options to the program that you want to list in GIT_SSH
895
-
you will need to wrap the program and options into a shell script,
896
-
then set GIT_SSH to refer to the shell script.
894
+
`$GIT_SSH_COMMAND` takes precedence over `$GIT_SSH`, and is interpreted
895
+
by the shell, which allows additional arguments to be included.
896
+
`$GIT_SSH` on the other hand must be just the path to a program
897
+
(which can be a wrapper shell script, if additional arguments are
898
+
needed).
897
899
+
898
900
Usually it is easier to configure any desired options through your
899
901
personal `.ssh/config` file. Please consult your ssh documentation
Original file line number Diff line number Diff line change
@@ -700,14 +700,23 @@ struct child_process *git_connect(int fd[2], const char *url,
700
700
701
701
conn->in = conn->out = -1;
702
702
if (protocol == PROTO_SSH) {
703
-
const char *ssh = getenv("GIT_SSH");
704
-
int putty = ssh && strcasestr(ssh, "plink");
703
+
const char *ssh;
704
+
int putty;
705
705
char *ssh_host = hostandport;
706
706
const char *port = NULL;
707
707
get_host_and_port(&ssh_host, &port);
708
708
port = get_port_numeric(port);
709
709
710
-
if (!ssh) ssh = "ssh";
710
+
ssh = getenv("GIT_SSH_COMMAND");
711
+
if (ssh) {
712
+
conn->use_shell = 1;
713
+
putty = 0;
714
+
} else {
715
+
ssh = getenv("GIT_SSH");
716
+
if (!ssh)
717
+
ssh = "ssh";
718
+
putty = !!strcasestr(ssh, "plink");
719
+
}
711
720
712
721
argv_array_push(&conn->args, ssh);
713
722
if (putty && !strcasestr(ssh, "tortoiseplink"))
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4