Disable Git Global Username and Email

Viewed 759

I want to disable the option for my git users that they can set a global username and email. I want it to be empty at all.

Now I have the problem, that when some of them set the global user.name and global user.email, all the commited codes goes by the same name in every project.

How can I solve this problem?

1 Answers

Global options are for each user to set (or not)

You would need for them to use, as in here:

git config --global user.useConfigOnly true

Any new repo will look for user.email only in their local .git/config file.
And the commit will not proceed if no user.email is found in the local git config.

That helps force the user define their identity in each of their repositories.

Related