direnv is one nifty tool which lets you have different environment variables based on directories/path. The best part is, as soon as you enter into a directory, direnv does it’s magic, so you don’t have to remember that you have to run direnv

Source: How I Am Maintaining Multiple Emails For Git On A Same Machine – blag