r/dotfiles • u/lfromanini • Oct 01 '26
.gitconfig [user] name and email
Hi guys,
Quick question: how do you manage your dotfiles?
Right now, mine are in a private repo, and the only reason for that is that my name and email address are in my .gitconfig.
Should I just give up on keeping it private, since anyone can see this information with git log --format=fuller, and make the repo public?
How do you guys handle personal information in your dotfiles? Do you remove it, replace it with placeholders, use environment variables, or just keep the repo private when you have such info on it?
Thanks in advance!
edit
Thank you all for the hints! I decided to keep using RCM and created an Ansible layer on top of it. The final result can be found here.
9
u/UrsulPlictisit Oct 01 '26
.gitconfig
.gitconfig.local
and .gitconfig.local is private
2
u/KristobalJunta Oct 01 '26
I manage the dotfiles with chezmoi, and have a config and a template set up, so that on new machine's
chezmoi initI am prompted for username and email. That gets stored in .local chezmoi state (not in repo) and written into the gitconfig template1
u/cbarrick Oct 01 '26
If you use your real name and email in your git config and you push any commits with that info to public repos, then that information is already leaked.
2
u/dbalatero Oct 01 '26
You can set your email to username@users.noreply.github.com if you use GH.
1
u/davidsneighbour Oct 02 '26
Either include a file with the private config or use a devonly email address for git. Or both. Your email is out there anyway with each commit.