Managing Multiple Git Configurations
If you’re like most developers, you probably work on multiple projects across different contexts. Maybe you contribute to open source projects with your personal email, work on company projects with your work email, and maintain client projects with yet another identity. Manually switching git configurations between projects is tedious and error-prone. Fortunately, Git has a powerful feature that solves this problem elegantly: conditional includes with includeIf. The Problem Consider this common scenario: You’ve just finished committing some personal project code, then switch to your work repository and make a commit. Hours later, you realize with horror that your personal email is now in your company’s git history. This can happen especially as development setups and projects increase in complexity over time. On-call all nighters don’t help either and it’s an easy mistake to make. ...