如果我用GIT_TRACE=2环境变量运行"git push“,我会得到以下结果:
09:25:28.098743 git.c:349 trace: built-in: git 'push' 'origin' 'master'
09:25:28.100261 run-command.c:341 trace: run_command: 'ssh' 'git@bitbucket.org' 'git-receive-pack '\''kevinburke/letter.git'\'''这很棒,但有时我会遇到这样的错误:
fatal: Could not read from remote repository.我只是间歇性的得到它,所以我不确定是怎么回事。我知道ssh有一个详细的模式:
-v Verbose mode. Causes ssh to print debugging messages about its progress.
This is helpful in debugging connection, authentication, and configuration
problems. Multiple -v options increase the verbosity. The maximum is 3.如果我能让git在打开-vvv情况下运行ssh命令,那就太好了。有没有办法通过环境变量或配置设置来启用它?
发布于 2014-08-20 02:06:52
将以下内容放在~/.ssh/config文件中:
Host <git-server-FQDN> LogLevel (QUIET|FATAL|ERROR|INFO|VERBOSE|DEBUG|DEBUG1|DEBUG2|DEBUG3)与服务器交互的后续git命令应该会产生所需的调试输出。
发布于 2016-03-16 22:27:11
在Git版本2.3.0中,您可以使用环境变量GIT_SSH_COMMAND并传递-v详细参数,如下所示:
GIT_SSH_COMMAND="ssh -v" git clone <REPO_SSH>您还可以传递-vvv以获取更详细的级别:
GIT_SSH_COMMAND="ssh -vvv" git clone <REPO_SSH>(如这里所示的https://askubuntu.com/a/620985/975188)
请注意,您也可以使用git push、git fetch等其他git命令运行此命令。
从Git版本2.10.0开始,您甚至可以按存储库或全局配置:
git config core.sshCommand "ssh -v"
git pull
git pushhttps://stackoverflow.com/questions/25388499
复制相似问题