Learning by reading

When I'm working as part of a Development team, working on open source projects, watching live streams or reading code that people have released online - such as their website or dotfiles - I read a lot of other people's code.

It's an opportunity to learn from others and how they approach things.

How they achieved a desired result or fixed a bug, which I can learn from.

I can refer to it if I need to do something similar in the future.

Or I may find something random that's I didn't know I needed, such as a module, library or configuration setting I wasn't aware of.

I recently learned about .mailmap files from Greg Hurrell (wincent)'s dotfiles on GitHub.

.mailmap is a file that is used by Git when displaying history, such as running git log, and allows you to define canonical names and email addresses for committers and contributors.

I've accidentally used the wrong email address or typed my name incorrectly before in my Git configuration, which was there for all to see, but this file allows me to consolidate my identities within a repository so my commits are grouped together and attributed to me, regardless of which email address I used or how I wrote my name.

You can see the one I added to my website directory.

If I hadn't looked at that repository, I wouldn't have learned about it.