Git - Local Config
Last updated on
Often on a work machine I might do some hobby work, but I don’t really want the work Git config in my history.
% git config user.email firstname.lastname@example.org
If you are on a nix type machine you can see the config here.
% cat ~/.gitconfig [user] name = Your Name email = email@example.com [core] repositoryformatversion = 0 etc ...
There is a way around this that might be quite useful, for one off checkouts like a blog or some lunchtime practice.
git clone your_hobby_repo cd your_hobby_repo cd .git cat config
Here you can see the config setting for this local repo. You can edit this file and add a user setting.
[user] name = Your Name email = firstname.lastname@example.org
Now when you call
git config user.email you should see your personal email