Skip to content
Follow
Ubuntu Linux

How to Set Up Git Username and Email on Ubuntu

Richard
Written by
Richard
Jan 25, 2024 Updated Aug 13, 2026 3 min read
How to Use Sticky Notes in Windows 11
How to Use Sticky Notes in Windows 11

Setting a Git username and email on Ubuntu links your identity to every code change you make so collaborators know who wrote the work. Git is a version control system that acts like a digital history book for your project files, tracking each modification you save.

Every time you save a change—called a commit—Git stamps your name and email onto that version. Running two quick commands in the Ubuntu terminal sets this up in less than a minute, ensuring your contributions get the right credit on platforms like GitHub.

⚡ Quick Answer

Configure your Git username and email on Ubuntu using the terminal. Run `git config –global user.name “Your Name”` and `git config –global user.email “your_email@example.com”` to set your global credentials.

Installing Git

Verifying Git installation on the machine precedes configuring usernames and emails. Opening the terminal and running this command handles missing installations:

🐧Bash / Shell
sudo apt update
sudo apt install git

Configure Git Username and Email

Ready systems handle username and email configuration through the git config command.

Settings apply globally or per repository. Running the git config command with the --global option establishes global commit names and email addresses.

Setting your Global Username

Open the terminal.

Run this command to set a global Git username:

💻Code
git config --global user.name "User_name" 

Substitute "Your Name" with the preferred name or username for Git commits.

Setting your Global Email Address

Run this command in the terminal to set a global email address (replacing your_email@example.com with the actual address):

💻Code
git config --global user.email "your_email@example.com" 

Substitute "your_email@example.com" with the actual email address linked to the Git or GitHub account.

Setting Username and Email for a Single Repository

Ubuntu allows configuring Git usernames and emails for single project folders. Separate project requirements benefit from unique author details. Opening the project folder in the terminal and applying the 'git config' command assigns names and emails to that specific project.

Navigate to the project directory:

Command Prompt
cd path/to/your/project 

Set the local username for this repository:

💻Code
git config user.name "Project Specific Name" 

Set the local email address for this repository:

💻Code
git config user.email "project_specific_email@example.com" 

Verifying your Configuration

Checking settings via the git config --list command follows username and email configuration.

💻Code
git config --list

Output displays all Git configuration settings. Locating user.name and user.email verifies the configurations.

Checking Global Configuration

💻Code
git config --global user.name
git config --global user.email

Checking Local Configuration

Checking saved project settings on Ubuntu confirms correct configuration. Terminal execution provides direct verification. Running git config user.name displays the username while git config user.email reveals the email associated with that project.

Correct information finalizes the Git setup process. Subsequent commits automatically apply the configured username and email address.

Re-running the git config command with new values modifies existing settings when necessary.

Configuration complete.

Conclusion:

  • Configuring your Git username and email is crucial for ensuring proper attribution of your commits
  • The proper contact information associated with your commits can facilitate communication with other developers
  • Installing Git and configuring your username and email are essential steps for a smooth Git setup on Ubuntu Linux

Can we change Git config username and email?

Changing names associated with Git commits utilizes the git config command. Updated names appear on all subsequent commits pushed to GitHub from the command line.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install Git and GitHub on Ubuntu: A Step-by-Step Guide
Ubuntu Linux How to Install Git and GitHub on Ubuntu: A Step-by-Step Guide
Working with Sudo and Su Commands in Ubuntu Linux
Ubuntu Linux Working with Sudo and Su Commands in Ubuntu Linux
How to Install OpenLiteSpeed on Ubuntu Linux
Ubuntu Linux How to Install OpenLiteSpeed on Ubuntu Linux
How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *