Tag: git

How to hide your email address in your Git commits but still get contributions to show up on your GitHub profile – 050

I have good news and bad news. Let’s start with the good news.

If you want to get credit for your commits, but don’t want to expose your GitHub email address in the commit logs (have you checked the logs? why haven’t you checked the logs*?), here are the steps you can take. 

contributions graph on GitHub profile

First, in GitHub go to Settings – Email – Keep my email address private

Keep my email address private checkbox

You’ll notice a new email saraford-tips@users.noreply.github.com for you to use for your Git commits.

Next, you’ll need to update Git to use this new noreply email instead of your real one. You can do this either from the command line or from GitHub Desktop.

From the command line, provided that you want to change your email address globally across all repos, you’ll simply do

$ git config –global user.email “your-username@users.noreply.github.com”

and then to verify, type

$ git config –global user.email

for example

git bash showing --global user.email changed

Or if you want to use GitHub Desktop, it’s just at Options – Configure Git which will do the same as the –global flag, hence the red circle around the global gitconfig message.

Configure git username and email address

You can read more in the GitHub Documentation for keeping your email address private, e.g. how to change only a specific repo, etc.

And now for the bad news.

This change will only apply moving forward. If you’ve been using your personal email address in previous Git commits, you’ll need to do some work to scrub the logs (where possible). Check out the GitHub Documentation for changing author info.

*My favorite all-time scary movie is the 1979 version of When a Stranger Calls. Well, not the entire movie, but just the first 15 minutes. And I don’t think it holds up anymore with smart phones being the norm. But wow, that was something scary! And yeah, you should check the logs… just to make sure you don’t have your email address committed that you don’t want others to see. 

How to add a new folder from the repo UI–#006

In the previous examples, you saw how to create a new file in the root directory. But suppose you wanted to create a new file in a new directory.

Follow the same steps as before by clicking the Create New File button. Then in the Name your file…  edit box, type your folder name, and then hit a forward slash (the / since it leans forward) .

81BF11C6-3214-4711-AB5B-9C56AF33E159

If you need to rename the new folder, press backspace until you backspace over the forward slash. Then you can retype the name of the folder.

Sometimes when I’m typing in an edit box, I’ll continue to hit backspace even though there’s nothing left to delete. I like that squeaky-clean feeling I’ve deleted it all. But if you’re like me and you’re thinking the cursor will just blink at you at the beginning of the file name edit box, yeah, you’re going to be in for a bit of a surprise. As I mentioned above, hitting backspace at the beginning of the file name edit box will deleted the forward slash, so you’ll now be editing the folder.

image

A 3-legged dog walks into a bar and says, “I’m looking for the man who shot my paw!”  It’s one of my favorites.

And yes, I’ve started experimenting with animated gifs. Where was Snagit back in 2008 when I did the VS Tips? Oh yeah, that’s right. It sat unused because I refused to give up my MSPaint keyboard shortcuts. Hopefully I’ll strike the right balance with animation on the page without too much motion!