# Using Multiple Author Identities With Git

DevFeed: [Using Multiple Author Identities With Git](<https://devfeed.tech/articles/using-multiple-author-identities-with-git-22310.md>)

Original publisher: [Read original article](<https://www.thecodedself.com/Using-Multiple-Author-Identities-With-Git/>)

Author: Keegan Rush

Published: 2017-02-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [The Coded Self](<https://devfeed.tech/sources/the-coded-self.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [bitbucket](<https://devfeed.tech/topics/bitbucket.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [bitbucket](<https://devfeed.tech/tags/bitbucket.md>), [charity](<https://devfeed.tech/tags/charity.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [version-control](<https://devfeed.tech/tags/version-control.md>), [work](<https://devfeed.tech/tags/work.md>)

## AI overview

This tutorial explains how to manage multiple author identities in Git. It covers global and repository-specific user configuration and notes that changing an author after committing modifies Git history.

## Source excerpt

How do you manage git credentials for different organizations? You may have some projects you work on at work that has a pre-push hook to ensure that your email is part of the correct domain. You might have your own personal projects, some of which might also use difference email addresses. Or, just maybe, you have a secret identity that you don't want your other repositories to know about. How does one manage this schizophrenic multiple personality disorder that we call Version Control? If I commit with the wrong email at work, I won't be allowed to push to our internal Bitbucket server. If I commit with the wrong email on one of my personal Github repositories, I end up with this ugly situation: The commits that don't have my image were made with my name but with an unknown email. So GitHub doesn't know that it was really me and does not link it to my Github identity. What I need to do is to tell git to use the email that Github expects. How to assume multiple identities Git commits have an author with a name and an email. Run git log in a repository you've committed to recently to see some of the metadata of your commits: commit bd294498cbd5c67b51096518ce62c9204068be2c Author: Bruce Wayne <bruce.wayne@wayneenterprises.com> Date: Tue Feb 14 19:58:34 2017 +0200 Plan attendance to charity events Git uses the user name and email set in your global .gitconfig file, located at ~/.gitconfig or C:\Users\MyUser\.gitconfig. The [user] block sets the author name and email address for all commits. You can set it by manually editing the file: $ vim ~/.gitconfig [user] name = "Bruce Wayne" email = "bruce.wayne@wayneenterprises.com" Git also provides a command to update global settings. $ git config --global user.name "Bruce Wayne" $ git config --global user.email bruce.wayne@wayneenterprises.com This modifies the global .gitconfig for you. Specifying identities at the repository level So now that you've created your global identity, how about adding a different one for a parti