title | intro | redirect_from | versions | shortTitle | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Setting your username in Git |
Git uses a username to associate commits with an identity. The Git username is not the same as your {% data variables.product.product_name %} username. |
|
|
Set your username |
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 {% 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.
{% data reusables.command_line.open_the_multi_os_terminal %}
-
{% data reusables.user-settings.set_your_git_username %}
git config --global user.name "Mona Lisa"
-
{% data reusables.user-settings.confirm_git_username_correct %}
$ git config --global user.name > Mona Lisa
{% data reusables.command_line.open_the_multi_os_terminal %}
-
Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.
-
{% data reusables.user-settings.set_your_git_username %}
git config user.name "Mona Lisa"
-
{% data reusables.user-settings.confirm_git_username_correct %}
$ git config user.name > Mona Lisa