Error: "git c:\$user\.gitconfig not found", but it does exist.

269 views
Skip to first unread message

henning....@gmail.com

unread,
Jul 28, 2015, 11:16:00 AM7/28/15
to tortoisegit-users
When committing I get an error that: "User name and email must be set before commit. Do you want to set there now?". Saying yes brings up the setting dialog.

In the Settings->Git dialog If I press "Edit global .gitconfig", I get an error dialog: "c:\$user\.gitconfig not found".

This is unexpected, because the file is there:  c:\nyUserName\.gitconfig, and appears to hold the required user information.
Also using git bash command:

git config --list

I get a list with the correct user.name and user.email etc.

So somehow tortoiseGit is "out of sync" with git.
Any ideas what can be wrong, and how to cure? 
Thx.

Sys info:
TortoiseGit 1.8.14.0 (C:\Program Files\TortoiseGit\bin) 
git version 1.9.5.msysgit.1 (C:\Program Files (x86)\Git\bin) 
Win7/64 bit. Windows domain 

Yue Lin Ho

unread,
Jul 28, 2015, 11:18:53 PM7/28/15
to tortoisegit-users, henning....@gmail.com


henning....@gmail.com於 2015年7月28日星期二 UTC+8下午11時16分00秒寫道:
When committing I get an error that: "User name and email must be set before commit. Do you want to set there now?". Saying yes brings up the setting dialog.

In the Settings->Git dialog If I press "Edit global .gitconfig", I get an error dialog: "c:\$user\.gitconfig not found".

This is unexpected, because the file is there:  c:\nyUserName\.gitconfig, and appears to hold the required user information.
Also using git bash command:

git config --list

I get a list with the correct user.name and user.email etc.


Did the user.name and user.email list twice? or once?
 
So somehow tortoiseGit is "out of sync" with git.
Any ideas what can be wrong, and how to cure? 


For setting User Name/Email, it's better:
1. click "Global" radio button in "Config source" group box
2. If "inherit" of Name/Email are checked, uncheck them.
3. set the Name and Email
4. Apply the change

Yue Lin Ho

 

ch3c...@gmail.com

unread,
Jul 29, 2015, 7:11:21 AM7/29/15
to tortoisegit-users, henning....@gmail.com
The path should be C:\Users\$user\.gitconfig, isn't it?


henning....@gmail.com於 2015年7月28日星期二 UTC+8下午11時16分00秒寫道:

henning....@gmail.com

unread,
Jul 29, 2015, 10:00:12 AM7/29/15
to tortoisegit-users, ch3c...@gmail.com
Sorry for being sluggish:
Yes the path which is quoted to be not found is
C:\Users\$USER\.gitconfig

There is however a file at:
c:\myUserName\.gitconfig
and i can edit it with a text editor. However when pushing button "tortoiseGit->settings->Git->Edit global .gitconfig" i get the error 

C:\Users\$USER\.gitconfig could not be found. Looks like this:

So is $USER really set properly - could explain it. Where can I check value of $USER?


Many thanks for your help, BR. Henning


henning....@gmail.com

unread,
Jul 29, 2015, 10:07:06 AM7/29/15
to tortoisegit-users, yueli...@gmail.com

Did the user.name and user.email list twice? or once?
 
user.name and user.email is only listed once in git config --list



For setting User Name/Email, it's better:
1. click "Global" radio button in "Config source" group box
2. If "inherit" of Name/Email are checked, uncheck them.
3. set the Name and Email
4. Apply the change

 Sorry, I am not sure I have found the right place you refer to.
Is it TortoiseGit->Settings->Git->...

apply changes gives similar dialog. Like $USER is pointing to something wrong.
thx. Henning

ch3c...@gmail.com

unread,
Jul 29, 2015, 11:14:25 AM7/29/15
to tortoisegit-users, henning....@gmail.com
TortoiseGit Settings -> General -> Show Environment Variables
Please report the Environment Variables here.

henning....@gmail.com於 2015年7月28日星期二 UTC+8下午11時16分00秒寫道:
gitconfignotfound1.png
gitconfignotfound2.png

henning....@gmail.com

unread,
Jul 29, 2015, 12:43:04 PM7/29/15
to tortoisegit-users, ch3c...@gmail.com
Here are an extract of env, variables. Note the line: HOME=C:\Users\$USER. Maybe thats the problem?
How to change to reflect my user name?


ch3c...@gmail.com

unread,
Jul 29, 2015, 12:56:55 PM7/29/15
to tortoisegit-users, henning....@gmail.com
Go to Windows Control Panel -> System -> Advanced System Settings -> Environment Variables
to check if HOME is defined

henning....@gmail.com於 2015年7月28日星期二 UTC+8下午11時16分00秒寫道:

henning....@gmail.com

unread,
Jul 29, 2015, 3:21:18 PM7/29/15
to tortoisegit-users, ch3c...@gmail.com
Great.Yes, HOME was defined but as  HOME --> c:\users\$USER

Correcting to c:\users\myUserName  using the environment variable editor for system variables, solved the problem.
Wonder how it got into that state. I guess HOME is used by many programs apart from TortoiseGit, so there is probably nothing to blame on TortoiseGit - could be any faulty installer causing this false entry.

Thanks again for your help. Br Henning


Reply all
Reply to author
Forward
0 new messages