Git config error when trying to set name and email

Viewed 163

I'm new to Git and Github and I'm just trying to set up my desktop client to be able to upload my projects.

When trying to commit I get this error from the desktop client:

Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  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 'wsm1u@DESKTOP-5ICE6RR.(none)')

So then I use Windows Powershell and get this error:

PS C:\WINDOWS\system32> cd $HOME
PS C:\Users\wsm1u>   git config --global user.email "wsm1usa1va1b@gmail.com"
>>
error: could not lock config file C:/desktop/.gitconfig: No such file or directory

Basically, I think the problem is that Git is searching for the config file in the wrong place, but I'm not sure how to have it search elsewhere.

Here are the solutions I've tried:

  1. uninstalling and reinstalling Git
  2. running Windows Powershell as admin (this gives back the same error message)
  3. Pasting a copy of .gitconfig in my desktop (this didn't work so I deleted it)
  4. running git lfs install --force to reset Git configuration, this gave the error message warning: error running C:\Program Files\Git\mingw64\libexec\git-core\git.exe 'config' '--includes' '--global' '--replace-all' 'filter.lfs.clean' 'git-lfs clean -- %f': 'error: could not lock config file C:/desktop/.gitconfig: No such file or directory' 'exit status 255' Run "git lfs install --force" to reset Git configuration.
  5. Tried to locate a .gitconfig.lock file as per this solution: https://askubuntu.com/questions/258288/trouble-setting-up-git-error-could-not-lock-config-file

Here is my system info: System information

Thank you for your help! :)

1 Answers

TL;DR

  1. I set my HOME
  2. Found some gitconfig files in my trash and deleted them
  3. I was able to set name and email through cmd as admin.
  4. I was able to commit!

Long version

  1. I ran cmd: set HOME and got

C:\Users\wsm1u>set HOME HOME=C:\desktop HOMEDRIVE=C: HOMEPATH=\Users\wsm1u

  1. I went to: https://superuser.com/questions/246731/how-do-i-change-homedrive-homepath-and-homeshare-in-windows-xp ⇒ Marc B's solution (setting home path through "advanced system settings")
  2. Committed through GitHub desktop -> got "tell me who you are" error
  3. Set email in cmd -> got blank return
  4. Set name -> got "permission denied" error
  5. Ran cmd as admin
  6. Set name -> got blank return
  7. Tried to commit again and "Please tell me who you are" error again.
  8. Ran git.bash as admin and set name/email then ran git config ‒list and got correct name and email returned
  9. Tried to commit and got "please tell me who you are" error again
  10. I tried creating a copy of my github desktop client in the program files directory because that is where my git directory is located. I thought maybe the client would only be able to find it that way (this made sense in my head) and that didn't work, so I deleted it.
  11. While I was in progam files though I noticed that there was a .gitconfig there and so I deleted that, then I emptied my trash and noticed there were more in there.
  12. Then I ran git config ‒list again and the name and email were gone from the return
  13. Then I set name and email again in cmd as admin and I WAS ABLE TO COMMIT FOR THE FIRST TIME!!!
Related