condran
2/13/2019 - 7:53 AM

Git config conditional includes

How to have conditional config for personal and work git user accounts https://dev.to/maxlmator/maintaining-different-git-identities

# ~/.gitconfig

[user]
    name = Firstname Lastname
    email = <private email address>

[includeIf "gitdir:~/Work/"]
    path = .gitconfig-work
# ~/.gitconfig-work

[user]
    name = Lastname, Firstname
    email = <work email address>