Git Course 0%

Accounts and profile

Intermediate GitLab UI ≈ 8 min

Before this lesson

What you will learn

  • Why the email on your commits decides whether they are attributed to you
  • The profile fields that matter to colleagues, and the ones that do not
  • How to set notifications so you see what concerns you and little else

After this lesson you can

  • My commits show my name and avatar, and my notifications are useful rather than noise

Why this matters

Two small settings decide whether GitLab treats your work as yours: the email address in your commits and the one verified on your account. Get them aligned once and every commit you ever make is attributed correctly. Get them wrong and your history shows a grey avatar and an unlinked name, which is confusing for everyone reading it later.

gitlab.com or your company's GitLab

GitLab comes in two forms, and which one you use changes the URL and almost nothing else:

gitlab.com (SaaS) Self-managed
URL gitlab.com your company's, for example gitlab.company.com
Sign-in email and password, or a provider such as Google often your company account through single sign-on
Version always current whatever your administrators installed; may lag by months
Who administers it GitLab your IT team

This course describes gitlab.com. On a self-managed instance the URLs differ, some features may be absent on your licence tier, and a few menus may be older. Everything about Git is identical.

Creating the account

  1. Go to your GitLab and select Register (or sign in with the provider your company uses).
  2. Choose a username. It becomes part of your URL (gitlab.com/your-username) and is hard to change later, so pick something you would put on a business card.
  3. Confirm the verification email.
  4. Enable two-factor authentication as soon as you have signed in, and save the recovery codes somewhere other than your phone (lesson 8.5).

The email question

Your commits carry whatever user.email says on your computer (lesson 3.3). GitLab links a commit to your profile only when that address is one of the verified addresses on your account. If it is not, the commit still arrives and is still yours in every practical sense; it simply shows an unlinked name and no avatar.

The fix is one of two things, whichever suits you:

  • Add the address to GitLab. Avatar → Edit profileEmails → add your work address and confirm it. You can have several; commits matching any verified address are linked.
  • Change the address in Git. git config --global user.email "the-verified-one@example.com", or set it per repository for a project that needs a different identity (lesson 3.4).

The profile fields that matter

Avatar → Edit profile. Most fields are optional; these three earn their place:

Field Why colleagues care
Full name It appears on every merge request, comment and commit. Use the name people call you at work
Avatar The fastest way to scan who did what in a long thread
Pronouns, Time zone Useful in a distributed team; the time zone tells a reviewer whether to expect an answer today

Busy and the status message (the emoji and text next to your name) are worth knowing: setting a status saying you are on leave stops people waiting on a review that will not come this week.

Notifications

The default is generous and quickly becomes noise. Avatar → PreferencesNotifications sets a global level, and each group and project can override it:

Level You are emailed about
Global whatever the level above says
Watch every activity in the project
Participate threads you created, commented on, or were mentioned in (the sensible default)
On mention only when someone writes @you
Disabled nothing

A practical setup: Participate globally, Watch on the one or two projects you own, On mention on the noisy ones you are only nominally part of. Then the mail you receive is mail you should read, which is the point.

How to do it

Nothing here is a Git command, but two commands connect your computer to the account you just made:

Terminal
$ git config --global user.email
ana@northwind-trails.example

Compare that with the verified addresses on your profile. And after any change:

Terminal
$ git config --global user.email "ana@northwind-trails.example"

Common mistakes

  • A commit email that is not verified on the account. Grey avatar, unlinked name. Add the address or change user.email.
  • Expecting an email change to fix old commits. It does not, and it does not need to.
  • A username you regret. It is in your profile URL and referenced from mentions; changing it later breaks links.
  • Leaving notifications at the default. Everything arrives, so nothing gets read, and a review request is missed.
  • No two-factor authentication. Most organizations require it eventually, and it is the reason tokens exist (lesson 8.5).

Try it yourself

Goal: confirm your commits will be attributed to you.

  1. Run git config --global user.email and note the address.
  2. On GitLab, open Avatar → Edit profile → Emails and check whether that exact address is listed and confirmed.
  3. If it is not, add it (or change your Git setting to one that is).
  4. Make a commit in your playground and push it, then look at it on the project's Code → Commits page.
  5. While you are there, set your notification level to Participate under Preferences → Notifications.

Expected result: the commit shows your avatar and links to your profile.

Show solution

If the commit still shows an unlinked name, the address in the commit is not the one you verified: git log -1 --format='%ae' prints the exact address the commit carries, which is the value to compare. Older commits keep whatever they had; only new ones pick up the change.

Check yourself

1. Your commits appear with your name but no avatar and no link to your profile. Why?
2. You change user.email today. What happens to last week's commits?
3. Which notification level sends mail only about threads you started, commented on, or were mentioned in?

Key terms

GitLab Commit