git: git version 2.10.1 (Apple Git-78)
macOS: 10.12.3
I am (was) having some issues with git, everything committed locally and then pushed up to GitHub is (was) not referenced in my account but rather committed by an unknown user.
I googled some online, as I always do, and came to this conclusion. The git config had been messed with. (Prev commits are fine etc.)
Naturally I tried setting my email in the git config to match the one on GitHub, this way GitHub would automatically notice the (new) commits are mine and everything would be fine..
So I ran
git config --global user.email <[email protected]>
Without success... The following error was returned to me:
error: could not lock config file /Users/<user>/.gitconfig: No such file or directory
I tried to reinstall/update git by downloading the latest version here.
Running git config --global -l
to list all of the configs returns the following error:
fatal: unable to read config file '/Users/<user>/.gitconfig': No such file or directory
The file does not seem to exist. As you can see in the screenshot. Reinstalling git via their website did not initiate the config file.
I have no clue what to do...
Other posts:
I tried resolving this issue by going trough other related answers etc. However this did not help me resolve this issue. I think my case is a little more specific than most cases...
Tried to create the folders:
Try
rm ~/.gitconfig
touch ~/.gitconfig
to remove the bad symlink and create a new config file.
Then re-run you command to create the setting:
git config --global user.email <[email protected]>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With