I'm looking for advice on managing multiple Git accounts for work and personal projects on the same laptop. Right now, I'm using two separate gitconfig files, each scoped to specific work folders, and I add the relevant SSH key for those files. Is there a better way to handle the Git environment in the terminal?
3 Answers
Honestly, I used to mix accounts, but now I keep them completely separate. My work laptop is exclusively for company projects, and I stick to my personal laptop for anything else. It's just not worth the hassle!
I've done something similar with multiple git configurations based on directory paths. The Git config includes allow for conditional SSH keys, which is super handy. And if you're using GitHub CLI, it now has an option to switch between accounts easily, which simplifies the process!
I totally get where you're coming from! I keep my work and personal accounts separate too. Using separate laptops is the safest way; you never want your employer to claim any personal work. Just the other day, someone mentioned they keep their personal projects 900 miles away from work. Seems like a smart move!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically