Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn off GIT_TRACE?

Tags:

git

I suddenly started receiving permission denied errors when trying to fetch from our git server. According to this document, I used the GIT_TRACE_PACKET AND GIT_TRACE commands. We found the problem and fixed it, but now every git command I run is getting traced. Can someone tell me how to turn this function off?

like image 399
EmmyS Avatar asked Jan 31 '14 18:01

EmmyS


2 Answers

While fixing a connection and permissions issue with Git, HTTPS, SSH, and a corporate proxy I ended up with a ton of leftover debug and verbose options and no real clear reason why these options were persisting.

If you end up in my position, you'll want to completely clean house:

  • GIT_TRACE, GIT_CURL_VERBOSE need to be unset or set to zero to turn off logging from Git or Git's usage of cURL

  • Custom ssh commands stored in GIT_SSH_COMMAND, GIT_SSH might be hiding a -v or --verbose that need to be cleared out

  • Set the LogLevel back to INFO in ~/.ssh/config and /etc/ssh/ssh_config for the domain(s) you're pulling against

  • Unset or remove the verbose options from the core.sshcommand in your gitconfig, you can use git config --list --show-origin to see all of your configurations and which files they live in

  • While you're looking at your gitconfig, check that your aliases aren't hiding verbose options

like image 189
worc Avatar answered Oct 15 '22 12:10

worc


As everyone said in comments, those are not actually commands. There is a command involved (export) but it's a shell (bash in your case, although there are other shells) command, not a git command. It changes the set of environment-variables that the shell provides to other commands.

So, you just need to un-do the thing you did in bash, with another bash command.

You can use SirBraneDamuj's method:

export GIT_TRACE_PACKET=0 GIT_TRACE=0

This keeps those variables in the environment but changes their value. Or, you can:

unset GIT_TRACE_PACKET GIT_TRACE

which removes those two names from the set of environment variables entirely. The effect on git will be the same either way. (For some other commands, and some other variables, there's sometimes a difference between "set to 0 or to empty-string" vs "not set at all", so it's worth remembering both methods.)

like image 30
torek Avatar answered Oct 15 '22 14:10

torek