Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Just starting with TortoiseGit, why does it need my email for a local repository?

I just installed Git + TortoiseGit, created a new local repository on my PC, added a file, and now I'm trying to commit it (I guess that's Commit -> "master").

However it says: "User name and email must be set before commit. Do you want to set these now?"

Ehh, this is supposed to be a local repository. What does any email address have to do with this?

Or am I misunderstanding the way Git works? Note that I'm not using GitHub or BitBucket or whatever. Just a local repository.

like image 988
Sheldon Pinkman Avatar asked Jan 10 '14 16:01

Sheldon Pinkman


1 Answers

The name and email are added to the commit by Git. It's not related to login credentials. It's useful to set at least the name, even if you don't want to set your email.

If you want to leave them blank then you can enter these commands in a terminal:

git config --global user.name ""
git config --global user.email ""

which should create a ~/.gitconfig file at your system's $HOME, which will look like:

[user]
name = 
email = 

Alternatively, just create or edit your current ~/.gitconfig file to look like this.

like image 130
Abizern Avatar answered Sep 19 '22 15:09

Abizern