1

I am running git version command from Git Bash and it is giving me error as follows. What is wrong?

I have reinstalled git again -

$ git version
warning: could not open 'C:\Users\sgupt503git.log' for tracing: Permission denied
git version 2.17.1.windows.2
wjandrea
  • 28,235
  • 9
  • 60
  • 81
Bokambo
  • 4,204
  • 27
  • 79
  • 130
  • 2
    Possible duplicate of [Git gives me a "Permission Denied" error when writing files that I am pulling](https://stackoverflow.com/questions/9200556/git-gives-me-a-permission-denied-error-when-writing-files-that-i-am-pulling) – Kraylog Jun 07 '19 at 17:36

1 Answers1

0

It looks like GIT_TRACE (Edit: see PS) variable is enabled in your environment. The environment settings almost always[*] are stored so that they are not affected by git reinstallation.

It looks like the directory C:\Users\ is not usually writable for users, that's why you are getting the error.

To fix the issue, open your environment variables settings and look up there for the variable GIT_TRACE... to remove it. If it's not there is can be in the shell start script like ~/.bashrc. Check if the issue reproduces if you start the git from cmd.exe.

[*] there may be some files in /etc which may affect environment of the bash session and are usually removed at git for windows uninstallation. But it is very unlikely anybody has touched them.

PS: actually, there are many variables like "GIT_TRACE...", scroll down in the document for them.

max630
  • 8,762
  • 3
  • 30
  • 55