Chuck's Academy

Git and GitHub

Installation and Configuration of Git

In this module, we will learn how to install Git on different operating systems and how to configure it to start working on your projects. The instructions below cover the most common operating systems: Windows, macOS, and Linux.

Git Installation

Windows

  1. Download Git: Visit git-scm.com and download the installer for Windows.
  2. Run the installer: Open the downloaded .exe file and follow the installation wizard instructions.
  3. Configure options: During the installation, make sure to select these options:
    • Default Editor: We recommend choosing Visual Studio Code or your preferred editor.
    • Add Git to the system PATH: This will allow you to use Git from the command line or any terminal.
  4. Complete the installation: Finish the wizard and verify the installation.
    bash

macOS

  1. Use Homebrew: If you already have Homebrew installed, simply run:
    bash
  2. Verify installation: Open Terminal and verify the installation.
    bash

Linux

  1. Ubuntu/Debian: Run these commands in the terminal:
    bash
  2. Fedora: Use the following command:
    bash
  3. Verify installation: In any distribution, verify the installation.
    bash

Git Configuration

Once Git is installed, it is important to configure it before starting to use it. There are two essential configurations: your name and your email. These are associated with your commits.

Global Configuration

  1. Set username:
    bash
  2. Set email:
    bash

Verify configuration

To ensure your configuration is correct, you can verify the set values:

bash

Text Editor Configuration

Git uses a text editor for various tasks, such as writing commit messages. You can set your default editor with the following command:

bash

Color Configuration

To improve readability, you can enable colorization in Git's output:

bash

Alias Configuration

Aliases can make Git commands shorter and easier to remember. For example, you can create an alias for the git status command:

bash

View Complete Configuration

To see the complete Git configuration on your system, you can use:

bash

With Git now installed and configured, you are ready to start using it in your projects. In the next module, we will explore the basics of version control and how Git implements them.


Ask me anything