How to Set Up Git Username and Email in Ubuntu
Git is a popular version control system that tracks changes in code through time. It helps developers to collaborate on projects and maintain version control. One of the essential configurations of Git is adding your name and email address. It associates your commit with your identity, providing a way for fellow developers to know who contributed to the project.
In this article, we will learn how to set up Git username and email in Ubuntu.
Step 1: Installing Git on Ubuntu
Before setting up Git, you need to install it on your Ubuntu system. Open Terminal and enter the following command to install Git:
sudo apt install git
Once Git is installed, verify the installation by running the following command:
git –version
Step 2: Setting up Git username and email
The Git username and email are critical for identifying the author of the code. Here’s how you can set up your Git username and email address:
1. Open the Terminal and navigate to your home directory by running the following command:
cd ~
2. Enter the following command to set up your Git username:
git config –global user.name “Your Name”
Replace “Your Name” with your actual name.
3. Enter the following command to set up your Git email:
git config –global user.email “youremail@example.com”
Replace “youremail@example.com” with your valid email address.
Step 3: Verify the Git username and email
To check if your Git username and email are set up correctly, run the following command:
git config –list
You should see your name and email listed as shown below:
user.name=Your Name
user.email=youremail@example.com
Conclusion
In conclusion, setting up your Git username and email address in Ubuntu is essential to identify the author of your code contributing to the shared repository. By following the steps mentioned above, you can quickly set up your Git username and email address in Ubuntu.