With a fresh install of MSysGit, emacs and magit when I try to commit I am getting:
128 c:/Program Files (x86)/Git/bin/git.exe --no-pager -c core.preloadindex=true commit --
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '<my username> @<my computer name>.(none)')
These config options are set (and I set them again to be sure, with --global), and I can otherwise normally commit files using git directly from the command line.
I don't use Windows myself so I cannot help much, but this sort of thing apparently often means that due to differences between the environments of the shell and emacs there is disagreement about where $HOME is.
I set them again to be sure, with --global)
If you do it without that extra argument, then the setting only applies to the current repository, so you always want to do this "globally". However --global doesn't mean "for all users" but "for all repositories of this user", so it doesn't help here.
You have to either figure out how to make the shell and emacs agree on where $HOME is or you could work around this issue using --system instead of --global. Or by duplicating all configuration files in "both $HOMEs". Obviously it's best to properly fix this, but I don't know how that is done.
Try searching for set $HOME on Windows; that seems to give relevant results. If you find a page that explains it really well then please post a link here.
Perfect, thank you!
The proper way is to set HOME environment variable to %APPDATA%, but that doesn't play very nice with msysgit.
Msysgit stores configuration in %USERPROFILE%, while everyone else is using %APPDATA%. The easiest way is to copy .gitconfig or create sym/hardlink.
Most helpful comment
I don't use Windows myself so I cannot help much, but this sort of thing apparently often means that due to differences between the environments of the shell and emacs there is disagreement about where
$HOMEis.If you do it without that extra argument, then the setting only applies to the current repository, so you always want to do this "globally". However
--globaldoesn't mean "for all users" but "for all repositories of this user", so it doesn't help here.You have to either figure out how to make the shell and emacs agree on where
$HOMEis or you could work around this issue using--systeminstead of--global. Or by duplicating all configuration files in "both$HOMEs". Obviously it's best to properly fix this, but I don't know how that is done.