I'm attempting to create a personal .gitconfig file to serve my personal and professional needs when coding.
I have managed to get credentials to be saved differently based on where the repo is located. See the Git config snippet below:
[credential "https://github.com"]
username = "myUsername"
helper = "store"
This seems to work fine and I am happy with the results.
I am now trying to do the same to user.name
and user.email
aswell.
See the Git config snippet below:
[user "https://github.com"]
email = "<private email>"
name = "<private alias>"
When I use this config and attempt to commit something, Git refuses and says:
*** 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.
I am certain that the repository I am committing against is located on GitHub.
I have seen some people use different include statements to solve this, but I would prefer to solve it with subconfigs if possible.
Can someone please help me get this working or at least explain why it is not possible (if that would be the case).
Thanks for any help.