1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/content/github/using-git/setting-your-username-in-git.md
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

1.9 KiB

title, intro, redirect_from, versions
title intro redirect_from versions
Setting your username in Git Git uses a username to associate commits with an identity. The Git username is not the same as your {{ site.data.variables.product.product_name }} username.
/articles/setting-your-username-in-git
free-pro-team enterprise-server
* *

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 {{ site.data.variables.product.product_name }} 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

{{ site.data.reusables.command_line.open_the_multi_os_terminal }}

  1. {{ site.data.reusables.user_settings.set_your_git_username }}
    $ git config --global user.name "<em>Mona Lisa</em>"
    

3. {{ site.data.reusables.user_settings.confirm_git_username_correct }}
 ```shell
 $ git config --global user.name
 > Mona Lisa

Setting your Git username for a single repository

{{ site.data.reusables.command_line.open_the_multi_os_terminal }}

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

  2. {{ site.data.reusables.user_settings.set_your_git_username }}

    $ git config user.name "<em>Mona Lisa</em>"
    

3. {{ site.data.reusables.user_settings.confirm_git_username_correct }}
 ```shell
 $ git config user.name
 > Mona Lisa

Further reading