👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-08-20. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Article version: Enterprise Server 2.18

Setting your username in Git

Git uses a username to associate commits with an identity. The Git username is not the same as your GitHub Enterprise username.

In this article

Were you able to find what you were looking for?

You can change the name that is associated with your Git commits using the git config command. The new name you set will be visible in any future commits you push to GitHub Enterprise from the command line. If you'd like to keep your real name private, you can use any text as your Git username.

Changing the name associated with your Git commits using git config will only affect future commits and will not change the name used for past commits.

Setting your Git username for every repository on your computer

  1. Open TerminalTerminalGit Bash.

  2. Set a Git username:

    $ git config --global user.name "Mona Lisa"
  3. Confirm that you have set the Git username correctly:

    $ git config --global user.name
    > Mona Lisa

Setting your Git username for a single repository

  1. Open TerminalTerminalGit Bash.

  2. Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.

  3. Set a Git username:

    $ git config user.name "Mona Lisa"
  4. Confirm that you have set the Git username correctly:

    $ git config user.name
    > Mona Lisa

Further reading

Were you able to find what you were looking for?

Ask a human

Can't find what you're looking for?

Contact us