git RemoteにSSHパラメータを提供しますか?

git RemoteにSSHパラメータを提供しますか?

何らかの理由でコマンドを実行しようとすると、sshコンソールがハングします。たとえば、

ssh user@server dateぶら下がる、

ssh -f user@server date働く

-fURLにパラメータを含めるにはgit remoteどうすればよいですか?今私にいます:

git remote add origin ssh://user@server/home/user/repo/mine.gitしかし、押したり引っ張ろうとすると止まります。-f問題が解決すると予想されるので、このURLにパラメータを追加したいと思います。

呼び出すときにパラメータを使用するようにどうすればわかりますかgit-fssh

ベストアンサー1

git(1)私たちが見つけた美しいマニュアルで

   GIT_SSH, GIT_SSH_COMMAND
       If either of these environment variables is set then git fetch and
       git push will use the specified command instead of ssh when they
       need to connect to a remote system. The command will be given
       exactly two or four arguments: the username@host (or just host)
       from the URL and the shell command to execute on that remote
       system, optionally preceded by -p (literally) and the port from the
       URL when it specifies something other than the default SSH port.

       $GIT_SSH_COMMAND takes precedence over $GIT_SSH, and is interpreted
       by the shell, which allows additional arguments to be included.
       $GIT_SSH on the other hand must be just the path to a program
       (which can be a wrapper shell script, if additional arguments are
       needed).

したがって、via Shellの最も簡単な説明は次のとおりです。

GIT_SSH_COMMAND="ssh -f" git push ...

またはでパッケージを完成させますGIT_SSH

おすすめ記事