EricO
EricO

Reputation: 49

eGit not using .gitconfig user

Using eGit to make a commit, the user name is consistently wrong and does not at all reflect what the .gitconfig file in my Win home directory shows (I've also searched for other .gitconfig files, none exist). egit insists on inventing some generated email address that combines my computer name with the domain it is attached - an email address that has only ever existed in egit's own mind.

When performing a commit and push, I have to alter the email each and every time. If I forget, I have to go back and correct it, then do it all over again. Where do I permanently inform egit what the user.email should be instead of the one it wants it to be?

Note: edited user.name to user.email

Upvotes: 0

Views: 111

Answers (1)

David M. Karr
David M. Karr

Reputation: 15225

I'm going to make a wild guess, based on my experience and some of the subtle wording you use here, that your Windows environment does not have the "HOME" environment variable set.

Assuming that's true, what I've discovered is that the eGit algorithm for finding the "home" git config to use doesn't work as well as I'd like. If HOME is set to the Windows HOME, it works fine. If not, it tries some other strategies that don't work for me.

You can verify this in a cmd shell by setting HOME to point to your Windows home, then running Eclipse from that shell, and verify that your git config looks good.

To deal with this, I have written a very small batch program called "runwithhome.cmd" that looks like this:

set HOME=C:\Users\%USERNAME%
start /min %*

This assumes that %USERNAME% is set to your userid.

I use this by changing the shortcut used to start Eclipse, adding the absolute path to this batch file at the beginning.

Note that you'll now have to edit the icon setting, finding the path to the eclipse.exe file.

Upvotes: 1

Related Questions