How do you manage multiple Git accounts on the same laptop?

0
5
Asked By SkyHighPineapple93 On

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

Answered By DevGuru19 On

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!

Answered By TechieBunny45 On

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!

Answered By CodeNinja72 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.