Every developer who has ever dealt with a personal project, a job, and perhaps a freelance project on the same machine knows the pain of accidentally git commit with the wrong email. Git allows you to manage multiple accounts using only native features of the tool.

Here I will show how I configured my Linux and Windows environment, how I keep my personal and work projects organized, making Git automatically use the corresponding accounts and the correct SSH key for each project. No more need to use git config --local user.email ... with each new clone!

The configuration uses two features of Git and SSH:

Multiple SSH Keys: A unique key for each Git provider (GitHub, GitLab, etc.) for authentication. 1.

Git Conditional Inclusion: The includeIf directive in your …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help