Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Git Configuration | Introduction to Git
course content

Course Content

Git Essentials

Git ConfigurationGit Configuration

In fact, there are two ways to interact with Git:

  • via a graphical interface, such as within a specific Integrated Development Environment (IDE);
  • via the Terminal (Git Bash).

In this course, we will use the Terminal (Git Bash) to interact with Git since it is often a more convenient and faster approach. Additionally, understanding how to use the Terminal (Git Bash) will make it easier for you to use a graphical interface.

Note

We strongly recommend that you follow along on your computer throughout our course, running the commands and experimenting with them.

However, before running any commands, let's discuss how to open the Terminal (Git Bash) on your operating system.

Windows Instructions

  1. Click on the Start menu or press the Windows key.
  2. Type Git Bash in the search bar.
  3. Click on the Git Bash application from the search results.
Finding Git Bash

macOS Instructions

  1. Press Command (⌘) + Space simultaneously. This will open Spotlight, a system-wide search feature.
  2. Type "Terminal" in the search bar, and you'll see "Terminal" or "Terminal.app" as one of the results.
  3. Click on "Terminal" in the search results. This will open the Terminal application.
Finding Terminal in Spotlight

Linux Instructions

  1. Press the Ctrl + Alt + T

Configuration

Now, let's proceed with the configuration. As we have already discussed, a Version Control System (VCS) should enable us to identify who made specific changes.

To achieve this, we need to configure some basic information in Git, specifically our username and email by setting respective values for them. To do so, run the following two commands:

Note

To run a certain command means to enter/paste this command in the terminal window and press the Enter key.

Here is an example of configuration:

Note

You can zoom in on every terminal screenshot in this course by clicking on it.

Replace email@example.com with your actual email address and username with your preferred username (do not remove double quotes). It is advisable to set your username to Firstname Lastname, where Firstname is your first name and Lastname is your last name.

As you can see, the fundamental command here is git config. When used with the --global flag, it sets the value for all Git repositories you will use. Later in the course, we will also cover how to set different values for specific repositories.

question-icon

Choose all INCORRECT options to configure the email address in Git.

Select a few correct answers

Everything was clear?

Section 1. Chapter 3
course content

Course Content

Git Essentials

Git ConfigurationGit Configuration

In fact, there are two ways to interact with Git:

  • via a graphical interface, such as within a specific Integrated Development Environment (IDE);
  • via the Terminal (Git Bash).

In this course, we will use the Terminal (Git Bash) to interact with Git since it is often a more convenient and faster approach. Additionally, understanding how to use the Terminal (Git Bash) will make it easier for you to use a graphical interface.

Note

We strongly recommend that you follow along on your computer throughout our course, running the commands and experimenting with them.

However, before running any commands, let's discuss how to open the Terminal (Git Bash) on your operating system.

Windows Instructions

  1. Click on the Start menu or press the Windows key.
  2. Type Git Bash in the search bar.
  3. Click on the Git Bash application from the search results.
Finding Git Bash

macOS Instructions

  1. Press Command (⌘) + Space simultaneously. This will open Spotlight, a system-wide search feature.
  2. Type "Terminal" in the search bar, and you'll see "Terminal" or "Terminal.app" as one of the results.
  3. Click on "Terminal" in the search results. This will open the Terminal application.
Finding Terminal in Spotlight

Linux Instructions

  1. Press the Ctrl + Alt + T

Configuration

Now, let's proceed with the configuration. As we have already discussed, a Version Control System (VCS) should enable us to identify who made specific changes.

To achieve this, we need to configure some basic information in Git, specifically our username and email by setting respective values for them. To do so, run the following two commands:

Note

To run a certain command means to enter/paste this command in the terminal window and press the Enter key.

Here is an example of configuration:

Note

You can zoom in on every terminal screenshot in this course by clicking on it.

Replace email@example.com with your actual email address and username with your preferred username (do not remove double quotes). It is advisable to set your username to Firstname Lastname, where Firstname is your first name and Lastname is your last name.

As you can see, the fundamental command here is git config. When used with the --global flag, it sets the value for all Git repositories you will use. Later in the course, we will also cover how to set different values for specific repositories.

question-icon

Choose all INCORRECT options to configure the email address in Git.

Select a few correct answers

Everything was clear?

Section 1. Chapter 3
some-alt