Skip to content

Instantly share code, notes, and snippets.

@BadgerCode
Last active February 6, 2024 14:35
Show Gist options
  • Save BadgerCode/5234b41581bcd8d0361b2a820fdf5002 to your computer and use it in GitHub Desktop.
Save BadgerCode/5234b41581bcd8d0361b2a820fdf5002 to your computer and use it in GitHub Desktop.
Use different emails for different git repositories

Edit ~/.gitconfig

[user]
        email = mike-h@badgercode.co.uk
        name = Michael Hawkins
[includeIf "hasconfig:remote.*.url:git@bitbucket.org:YOUR_COMPANY_NAME/**"]
        path = ~/Documents/Projects/Work/.gitconfig

Edit ~/Documents/Projects/Work/.gitconfig

[user]
        email = michael.hawkins@company.com
        name = Michael Hawkins

See also https://gist.github.com/Icaruk/f024a18093dc28ec1588cfb90efc32f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment