Skip to content

Instantly share code, notes, and snippets.

@arjenblokzijl
Created February 26, 2021 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjenblokzijl/81761066792edcdf7837849b0dedcb2d to your computer and use it in GitHub Desktop.
Save arjenblokzijl/81761066792edcdf7837849b0dedcb2d to your computer and use it in GitHub Desktop.
Separate work and personal git accounts

Edit global gitconfig file

git config --global --edit

# This is Git's per-user configuration file.
[user]
	name = Your Work Name
	email = user@workemail.com

[includeIf "gitdir:~/Documents/Sideprojects/"]
	path = ~/Documents/Sideprojects/.gitconfig

Edit "local" gitconfig file

~/Documents/Sideprojects/.gitconfig

[user]
	name = Your Personal Name
	email = user@personalemail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment