Git操作时显示详细信息

在进行某些调试时,可能希望让Git现实详细的操作信息,此时,可以通过将GIT_TRACEGIT_TRACE_PACKETGIT_CURL_VERBOSE三个变量设为1实现:

Windows上:

set GIT_TRACE=1
set GIT_TRACE_PACKET=1
set GIT_CURL_VERBOSE=1

Linux上:

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

例如,在Windows上追踪一次克隆操作:

@echo off

REM Start time
echo Started at
date /T
time /T
echo=

REM Real work here
set GIT_TRACE=1
set GIT_TRACE_PACKET=1
set GIT_CURL_VERBOSE=1
git clone http://GitServer/UserName/RepoName.git

REM End time
echo Ended at
date /T
time /T
echo=

pause > NUL

参考资料:

https://stackoverflow.com/questions/38618885/error-rpc-failed-curl-transfer-closed-with-outstanding-read-data-remaining/39255923#39255923

it
除非特别注明,本页内容采用以下授权方式: Creative Commons Attribution-ShareAlike 3.0 License