Say, you have the following directory structure:

Windows:  
C:\source\work  
C:\source\pet

Linux:  
/home/<username>/source/work
/home/<username>/source/pet

With project repositories under both.

One should use your work email "me@work.com", the other your personal one "me@home.com".

Open the Git global config file:

Windows: C:\Users\<username>\.gitconfig  
Linux: /home/<username>/.gitconfig  

Change it to the following:

[includeIf "gitdir:c:/source/work/"]
    path = .gitconfig-work

[includeIf "gitdir:c:/source/pet/"]
    path = .gitconfig-pet

(or on Linux)

[includeIf "gitdir:/home/<username>/source/work/"]
    path = .gitconfig-work

[includeIf "gitdir:/home/<username>/source/pet/"]
    path = .gitconfig-pet

Create two new files in the same directory,

".gitconfig-work"

[user]
    email = me@work.com
    name = My Work Name

... and ".gitconfig-pet":

[user]
    email = me@home.com
    name = My Home Name

Done!

C:\source\work\project-1> git config --list  
user.email=me@work.com  
user.name=My Work Name  
C:\source\pet\project-a> git config --list  
user.email=me@home.com  
user.name=My Home Name