Your Git username is the name you chose when you created your account, and you can find it in your account settings or by running a command in your terminal.
Git is version control software that tracks changes to code. When you use Git, you need a username to identify yourself — this is different from your email address, though they're often confused. Your username is what appears next to your commits and is visible to anyone who looks at your project history.
The fastest way to find your username depends on where your code lives. If you use GitHub, GitLab, or Bitbucket, each platform stores your username in a different place. If you work with Git on your own computer without a hosting platform, you may have set a username locally that only exists on that machine.
Key Takeaways
- Your Git username is the account name you created, not your email address, and it's visible to anyone who sees your commit history.
- On GitHub, your username appears in your profile URL and in your account settings under "Account" or "Profile".
- On your local computer, you can check your Git username by running git config user.name in the terminal.
- If you've never set a local username, Git won't know who you are until you run git config --global user.name "Your Name".
- Your local username and your GitHub username can be different — they're separate settings.
Check your username on GitHub
If your code is hosted on GitHub, your username is the handle that appears in your profile URL. Open GitHub in your browser and look at the address bar when you're on your own profile page — it will show github.com/your-username. That string after the slash is your username.
You can also find it by clicking your profile picture in the top right corner and selecting "Settings". On the left sidebar, click "Account" (or "Profile" depending on your GitHub version). Your username appears near the top of the page, often labeled as "Username" or "Name".
Check your username on GitLab or Bitbucket
GitLab and Bitbucket work the same way as GitHub. On GitLab, click your profile picture in the top right, select "Preferences", and look for "Username" on the left sidebar. Your username also appears in your profile URL: gitlab.com/your-username.
On Bitbucket, click your profile picture, select "Personal settings", and find "Username" in the Account section. Your Bitbucket URL follows the same pattern: bitbucket.org/your-username.
Check your local Git username on your computer
If you work with Git on your computer without uploading to GitHub or another platform, you have a local username that only exists on that machine. Open your terminal or command prompt and type git config user.name, then press Enter. Git will print your local username if you've set one.
If nothing prints, you haven't set a local username yet. You can set one by running git config --global user.name "Your Name", replacing "Your Name" with whatever name you want to appear in your commits. The --global flag means this username will explore to all projects on your computer; without it, the setting applies only to the current project.
Understand the difference between local and hosted usernames
Your local Git username (the one on your computer) and your GitHub username are completely separate. You could have a local username of "alice" and a GitHub username of "alice-smith" — Git doesn't care. The local username is what appears in commits you make on your computer; the GitHub username is what appears when you push those commits to GitHub.
This matters because if you work on multiple machines or switch between platforms, you might have different usernames in different places. When you clone a repository from GitHub and start making commits, Git uses your local username, not your GitHub username, unless you've specifically configured it otherwise.
Change your username if you need to
On GitHub, GitLab, or Bitbucket, you can change your username in your account settings. Go to Settings, find the Username field, and type a new one. The platform will tell you if the name is already taken. Changing your username on the platform does not change your local Git username on your computer — you'll need to update that separately using git config --global user.name "New Name".
Keep in mind that changing your GitHub username will change your profile URL, so any links to your old profile will break. Some platforms warn you about this before you confirm the change.
Frequently Asked Questions
Is my Git username the same as my email address?
No. Your Git username is a separate account name you chose. Your email is associated with your account but is not your username. You can see both in your account settings — they're listed separately.
Can I have different usernames on different platforms?
Yes. You could be "alice-dev" on GitHub and "alice.smith" on GitLab. Each platform manages its own usernames independently. Your local Git username on your computer is also separate from all of them.
What if I forgot my GitHub username?
Log into GitHub and click your profile picture in the top right. Select "Settings" or "Profile". Your username appears in the Account section or in your profile URL. If you can't log in, use the "Forgot password" link on the GitHub login page to reset your account.
Does changing my username break my old commits?
No. Commits you've already made keep the username that was set when you made them. Changing your username only affects new commits going forward. Old commits will still show the old name.
Why does Git ask for a username if I'm using GitHub?
Git on your computer and GitHub are separate systems. Git needs to know who you are locally so it can label your commits. GitHub needs to know who you are so it can store your code under your account. They don't automatically sync — you have to set both.