Hacker News new | ask | show | jobs
by gurjeet 2050 days ago
I rely on Git's `user.useConfigOnly` option to force myself to set my email per repository. This is what my `user` section in ~/.gitconfig looks like.

  [user]
    name = Gurjeet Singh
    # Tell Git to _not_ guess my name and email based on `whoami` and `hostname`
    useConfigOnly = true
With this in place, whenever I try to commit for the first time in a repository, Git prompts me

  *** Please tell me who you are.*
I then add an email address to the repo-local config based on whether it's work or personal project.

  git config user.email me@example.com