Beginner20 minutesGitLevel 1

Installing Git & Recommended Tools

Learning Objectives

By the end of this lesson, you'll be able to:

  • Install Git on your operating system
  • Configure Git with your name and email
  • Verify your Git installation
  • Explore recommended GUI tools for Git

Why This Matters:

Having Git properly installed and configured is the foundation for everything else in this tutorial series. A correct setup now prevents frustrating issues later.

Before You Start:

You should be familiar with:

  • Be comfortable using the command line
  • Have administrator privileges on your computer

Step 1: Install Git

Git is available for Windows, macOS, and Linux. Follow the instructions below to install Git on your operating system:

Windows

Visit the official Git website: https://git-scm.com/

Download the installer and follow the setup wizard.

During installation, select the following options:

  • Use Git from the command line and third-party software
  • Use the default editor (or choose your preferred editor)
  • Use Git from Git Bash only

macOS

Open the Terminal and type the following command:

This will install Git along with the Xcode Command Line Tools.

Linux

Use your package manager to install Git. For example:

Step 2: Configure Git

After installing Git, you need to configure your identity. This information will be attached to your commits.

To verify your configuration, run:

Step 3: Verify Installation

To ensure Git is installed correctly, run the following command:

You should see the installed version of Git.

Recommended GUI Tools

While Git is primarily used via the command line, there are several GUI tools that make it easier to visualize and manage your repositories:

GitHub Desktop

A free and user-friendly Git client for Windows and macOS. Ideal for beginners.

Download GitHub Desktop

Sourcetree

A powerful Git GUI client for Windows and macOS, developed by Atlassian.

Download Sourcetree

GitKraken

A cross-platform Git client with a sleek interface and advanced features.

Download GitKraken

Setting Up Git in VS Code

Visual Studio Code has built-in Git support, making it easy to manage your repositories directly from the editor. Follow these steps to set up Git in VS Code:

Step 1: Open the Source Control Panel

Click on the Source Control icon in the Activity Bar on the left side of the editor. If you have a Git repository initialized in your project folder, it will automatically appear here.

Step 2: Configure Git in VS Code

If you haven't already configured Git globally, VS Code will prompt you to set your name and email. You can also configure it manually by running the following commands in the integrated terminal:

Step 3: Commit Changes

To commit changes, stage your files by clicking the icon next to the file name in the Source Control panel. Then, enter a commit message in the text box and click the checkmark icon to commit.

Step 4: Push and Pull Changes

Use the Source Control panel to push your changes to a remote repository or pull changes from it. You can also use the integrated terminal to run git push and git pull commands.

Step 5: View Git History

Install the Git History extension to view your commit history in a visual format. This can be helpful for tracking changes and understanding your project's timeline.

🏁 Lesson Complete: Git Installation

Key Takeaways:

  • Git can be installed on Windows, macOS, and Linux with just a few steps
  • Configuring your name and email is essential so Git can identify your commits
  • Use git --version to verify your installation is working
  • GUI tools like VS Code, Sourcetree, and GitKraken make Git more visual and beginner-friendly
  • VS Code has built-in Git support for staging, committing, pushing, and pulling

Learning Objectives Review:

Look back at what you set out to learn. Can you now:

  • ✅ Install Git on your operating system Check!
  • ✅ Configure Git with your name and email Got it!
  • ✅ Verify your Git installation Can explain it!
  • ✅ Explore recommended GUI tools for Git Could teach this!

If you can confidently answer "yes" to most of these, you're ready to move on!

Think & Reflect:

💭 💭 Reflection Questions

  • Were you able to install Git without issues? If not, what problems did you encounter?
  • Do you prefer using Git from the command line or a GUI tool?
  • Why is it important to set your name and email in Git?

🎯 Looking Ahead:

Now that Git is installed and configured, you're ready to learn the basic Git commands for tracking your code changes.

Recommended Next Steps

Continue Learning

Ready to move forward? Continue with the next tutorial in this series:

Basic Commands

Related Topics

Explore these related tutorials to expand your knowledge:

Progress tracking is disabled. Enable it in to track your completed tutorials.