* Rename map topic * Delete map topic * Rename map topic * Add redirect * Remove last two map topics * Move article on adding a remote into a long-form guide * Move article on changing a remote's URL * Move articles on renaming and removing remotes * Move remote URL article * Fix typo * Remove category index file * Move a few articles to the new category * Move a few more files * Move managing remote repos article * Move the rest of the getting started with git map topic * Move the first half of the using git map topic * Move the rest of the articles and 🔥 the directory * Fix failing test * Remove Using Git from product index * Apply suggestions from code review Co-authored-by: Laura Coursen <lecoursen@github.com> * Apply suggestions from code review Co-authored-by: Laura Coursen <lecoursen@github.com>
53 lines
2.0 KiB
Markdown
53 lines
2.0 KiB
Markdown
---
|
|
title: Setting your username in Git
|
|
intro: '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.'
|
|
redirect_from:
|
|
- /articles/setting-your-username-in-git
|
|
- /github/using-git/setting-your-username-in-git
|
|
versions:
|
|
free-pro-team: '*'
|
|
enterprise-server: '*'
|
|
github-ae: '*'
|
|
---
|
|
|
|
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.
|
|
|
|
### Setting your Git username for *every* repository on your computer
|
|
|
|
{% data reusables.command_line.open_the_multi_os_terminal %}
|
|
|
|
2. {% data reusables.user_settings.set_your_git_username %}
|
|
```shell
|
|
$ git config --global user.name "<em>Mona Lisa</em>"
|
|
```
|
|
|
|
3. {% data reusables.user_settings.confirm_git_username_correct %}
|
|
```shell
|
|
$ git config --global user.name
|
|
> Mona Lisa
|
|
```
|
|
|
|
### Setting your Git username for a single repository
|
|
|
|
{% data reusables.command_line.open_the_multi_os_terminal %}
|
|
|
|
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. {% data reusables.user_settings.set_your_git_username %}
|
|
```shell
|
|
$ git config user.name "<em>Mona Lisa</em>"
|
|
```
|
|
|
|
3. {% data reusables.user_settings.confirm_git_username_correct %}
|
|
```shell
|
|
$ git config user.name
|
|
> Mona Lisa
|
|
```
|
|
|
|
### Further reading
|
|
|
|
- "[Setting your commit email address](/articles/setting-your-commit-email-address)"
|
|
- ["Git Configuration" from the _Pro Git_ book](https://git-scm.com/book/en/Customizing-Git-Git-Configuration)
|