HTTP/2 301
content-length: 0
location: https://docs.github.com/articles/setting-your-username-in-git
HTTP/2 302
access-control-allow-origin: *
content-security-policy: default-src 'none';prefetch-src 'self';connect-src 'self';font-src 'self' data:;img-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com data: placehold.it;object-src 'self';script-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' data: 'unsafe-inline';script-src-attr 'self';frame-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com https://support.github.com https://www.youtube-nocookie.com;frame-ancestors 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com;style-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' 'unsafe-inline' data:;child-src 'self';manifest-src 'self';upgrade-insecure-requests;base-uri 'self';form-action 'self'
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-xss-protection: 0
cache-control: public, max-age=60
location: /en/get-started/git-basics/setting-your-username-in-git
content-type: text/plain; charset=utf-8
x-github-backend: Kubernetes
x-github-request-id: 1294:2E1CDB:3FADD5D:513E0F7:6953A9A7
accept-ranges: bytes
age: 0
date: Tue, 30 Dec 2025 10:30:23 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210051-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1767090624.754152,VS0,VE244
vary: accept-language, x-user-language, Accept
strict-transport-security: max-age=31557600
content-length: 77
HTTP/2 200
access-control-allow-origin: *
content-security-policy: default-src 'none';prefetch-src 'self';connect-src 'self';font-src 'self' data:;img-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com data: placehold.it;object-src 'self';script-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' data: 'unsafe-inline';script-src-attr 'self';frame-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com https://support.github.com https://www.youtube-nocookie.com;frame-ancestors 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com;style-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' 'unsafe-inline' data:;child-src 'self';manifest-src 'self';upgrade-insecure-requests;base-uri 'self';form-action 'self'
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-xss-protection: 0
cache-control: public, max-age=60
x-powered-by: Next.js
content-type: text/html; charset=utf-8
x-github-backend: Kubernetes
x-github-request-id: 08D1:361BCE:194E78C:207B92D:6953A99D
content-encoding: gzip
accept-ranges: bytes
age: 1
date: Tue, 30 Dec 2025 10:30:25 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210051-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1767090624.027552,VS0,VE997
vary: Accept-Encoding
strict-transport-security: max-age=31557600
content-length: 22677
Setting your username in Git - GitHub Docs Skip to main content
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 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 GitHub 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.
Open Terminal Terminal Git Bash .
Set a Git username:
git config --global user.name "Mona Lisa"
Confirm that you have set the Git username correctly:
$ git config --global user.name
> Mona Lisa
Open Terminal Terminal Git Bash .
Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.
Set a Git username:
git config user.name "Mona Lisa"
Confirm that you have set the Git username correctly:
$ git config user.name
> Mona Lisa