How to automatically switch git profiles based on the current directory

Git Profile Automation Guide

Learn to automatically switch between work and personal Git profiles


Automatically switch Git profiles based on the directory you're in

Automatically switch Git profiles based on the directory you're in

I code a lot for myself: https://github.com/zackproser

I code a lot for work: https://github.com/zackproser-workos

And I don't want to have to manually remember which Git profile to use for each context.

What I really want to do is just build things and have my computer figure out which Git profile to use based on the directory I'm in.

Here's how I automated this process using Git's built-in capabilities.

Automate Your Git Profile Switching

Automatically switch Git profiles based on the directory

Stop manually switching between Git profiles. Learn how to automatically use the right Git profile based on your current directory. Perfect for developers who work on both personal and work projects.