to select ↑↓ to navigate
Developer References

Developer References

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Getting Started with Git

Setting Git username

For every repository on computer

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

For a single repository

Change the current working directory to the local repository:

$ cd path/to/repository

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

Setting your email address

For every Git commits

Set an email address in Git:

$ git config --global user.email "email@example.com"

Confirm that you have set the email address correctly in Git:

$ git config --global user.email email@example.com

For a single repository:

$ git config user.email "email@example.com"

Confirm that you have set the email address correctly in Git:

$ git config user.email email@example.com

Last updated 2 months ago
Was this helpful?
Thanks!