我如何使用SSH详细模式运行git push / pull命令? [英] How can I run git push/pull commands with SSH verbose mode?

查看:523
本文介绍了我如何使用SSH详细模式运行git push / pull命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果使用GIT_TRACE = 2环境变量运行git push,我会得到以下结果:

If I run "git push" with the GIT_TRACE=2 environment variable, I get the following:

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'\'''

除非有时我得到这个错误,这是很好的:

Which is great except sometimes I get this error:

fatal: Could not read from remote repository.

我只是间歇性地收到它,所以我不确定发生了什么。我知道ssh有一个详细模式:

I only get it intermittently so I'm not sure what's going on. I know ssh has a verbose mode:

 -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命令。有没有办法使用环境变量或配置设置来启用它?

It would be great if I could get git to run that ssh command with -vvv turned on. Is there a way to enable this with environment variables or with config settings?

推荐答案

把这个放在〜/ .ssh / config file:

Put this in your ~/.ssh/config file:

Host <git-server-FQDN> LogLevel (QUIET|FATAL|ERROR|INFO|VERBOSE|DEBUG|DEBUG1|DEBUG2|DEBUG3)

与服务器交互的git命令应该产生所需的调试输出。

Subsequent git commands that interact with the server should produce desired debug output.

这篇关于我如何使用SSH详细模式运行git push / pull命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆