How to use separate Git emails for work and personal use

You, how-togit
  1. Create separate directories for work and personal use.
mkdir work
mkdir personal
  1. Create a Git config file per directory.
touch ~/.gitconfig-work
touch ~/.gitconfig-personal
  1. Update each config file with relevant details.
# ~/.gitconfig-work

    email =
    name = Work Name
# ~/.gitconfig-personal

    email =
    name = Personal Name
  1. Update the global Git config file to use relevant config files per directory.
# ~/.gitconfig

[includeIf "gitdir:~/work/"]
    path = .gitconfig-work
[includeIf "gitdir:~/personal/"]
    path = .gitconfig-personal
© Josh Bochu