brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: use your GitHub noreply address as git user.email to keep your mail address out of commits

Git
~/tips/tip-privacy-git-noreply-email

git config --global user.email "[email protected]"

Puts GitHub's noreply address in your commits instead of your real email address.

Every commit carries an email address, and public repositories make that address public for good. I would rather not have my real one in there. GitHub gives you a noreply address for exactly this, and a git setting plus one switch on GitHub keep it that way.

First turn on Keep my email addresses private in the GitHub settings under Emails. Then set the address in git. The format for accounts created after July 18, 2017 is your ID number and username:

git config --global user.email "[email protected]"
git config --global user.email

The second line prints the value back so you can check it. Leave out --global inside a repository to set the address for that repository only.

There is also a safety net: on the same page you can select Block command line pushes that expose my email. After that GitHub checks the most recent commit when you push, and if the author email is a private email of your account, the push is blocked with a warning.

The caveat: git only uses the new address for commits you make from now on. Commits made before the change keep the old address, and a new setting does not remove it from history. Also, use the ID version of the address. The older form without the number breaks the link between your commits and your account when you rename your username, and the docs say the ID-based one does not.

Further reading: Setting your commit email address (GitHub Docs), Email addresses reference (GitHub Docs), Blocking command line pushes that expose your personal email address (GitHub Docs)

Going deeper: Moving on from hdtv: how to export your TV show list to Trakt.tv

More Git tips git show-branch main feature git log --stat -5 git merge --no-ff feature -m "Merge feature" git merge --squash feature git merge --abort All Git tips (144) All topics

Link