DEV Community

Cover image for Quick Tip: Make Sure Your Work Follows You
James Thompson
James Thompson

Posted on

Quick Tip: Make Sure Your Work Follows You

Photo by Free Walking Tour Salzburg on Unsplash

Production Matters

This is a quick tip to make sure your work follows you on GitHub. You can do this by making sure the email associated with your commits is a universal GitHub email address.

Why does this matter? If you ever push your company’s production code to GitHub using your company’s email address, those commits associated with that email go away when you leave the company. Rather, they go away if you ever delete the email address from your GitHub account. You would want to do this since commit messages will continue to be routed to this email address, or until your company deactivates your account.

Don’t Reply

GitHub has a built-in feature to associate a no-reply email address for your commits with your GitHub account. It describes it as a way to keep your email address private, which it does. An additional bonus is that you can use it as a universal email address for all of your personal and professional work.

This is how it will look:

YOUR_GITHUB_USER_ACCOUNT@users.noreply.github.com
Enter fullscreen mode Exit fullscreen mode

So in my case, it looks like this:

100stacks@users.noreply.github.com
Enter fullscreen mode Exit fullscreen mode

You would configure this from your terminal command line (the quotes are required):

git config --global user.email "GITHUB_ACCOUNT@users.noreply.github.com"
Enter fullscreen mode Exit fullscreen mode

Verify it is changed by entering the following command in the terminal:

git config --global user.email
Enter fullscreen mode Exit fullscreen mode

That’s it! You’ve made the change.

Ok, one more thing…

If you use SSH to access your GitHub account, and YOU SHOULD in any production environment 🫣, you will need to complete a few more steps which I covered in another article.

Lastly, Trust But Verify

Having SSH configured is a great step towards a secure, distributed, CI/CD production environment. If you want to take additional steps for a more secure development environment, I will cover an advanced configuration that most developers do not use in a future article.

Top comments (0)