Setting Up Git

Welcome back, everyone! In today’s post, we’ll focus on getting Git set up on your system and configuring some basic settings. Don’t worry; I’ll explain everything in non-technical terms so that everyone can follow along. Let’s dive right in!

Installing Git

Download Git

  1. Go to the official Git website: https://git-scm.com/.
  2. Look for a prominent download button on the homepage. It’s usually labeled “Download for Windows,” “Download for macOS,” or “Download for Linux” Click on the appropriate one for your operating system.

Installation

For Windows:

  • Once the download is complete, double-click the downloaded file to start the installer.
  • Follow the on-screen instructions, leaving most settings as their default values.
  • When you reach the “Adjusting your PATH environment” screen, choose the “Use Git from the Windows Command Prompt” option. This will make Git accessible from the regular command prompt.

For macOS:

  • Open the downloaded .dmg file.
  • Drag the Git icon into the Applications folder.
  • Open Terminal and type git --version to ensure Git was installed correctly.

For Linux:

  • Use your package manager (e.g., apt, yum, or dnf) to install Git. The command may vary based on your Linux distribution.
  • After installation, open a terminal and type git --version to verify that Git is installed.

Verify Installation

In your terminal or command prompt, type:

git --version

You should see Git’s version information, which confirms that Git is installed on your system.

 ~ % git --version
git version 2.37.1 (Apple Git-137.1)

Configuring Basic Settings

Now that Git is installed, let’s configure some basic settings so that Git knows who you are when you make commits. This helps keep track of who made what changes in a project.

Set Your Name and Email

In your terminal or command prompt, type the following commands, replacing “Your Name” and “Your Email” with your actual name and email address:

git config --global user.name "Your Name" git config --global user.email "Your Email"

These settings are global and will be used for all your Git repositories.

Verify Configuration

To double-check that you’ve set your name and email correctly, type:

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

You should see your name and email displayed on the screen.

That’s it! You’ve successfully installed Git and configured some basic settings. You’re now ready to start using Git for version control in your projects.

In our next post, we’ll learn how to create your first Git repository and make your first commit. Stay tuned!


Let’s recap trying to answer the following questions 🙂

Question 1: What is the purpose of setting your name and email in Git configuration?

a) To customize the appearance of your Git terminal.

b) To set your preferred text editor for Git.

c) To identify yourself as the author of commits.

d) To change the color scheme of Git's user interface.

Question 2: Where can you download Git for your specific operating system?

a) Only from the Mac App Store.

b) The official Git website.

c) Any software download website.

d) The terminal using a command like "git download."

Question 3: Which step is necessary for Windows users during the Git installation process?

a) Choosing a username and password.

b) Selecting the type of version control system.

c) Deciding on the installation path.

d) Configuring Git to work with the Windows Command Prompt.

Question 4: What command should you use to verify if Git is installed correctly on your system?

a) check git installation

b) git --verify

c) git status

d) git --version

Question 5: After configuring your name and email in Git, where can you check to ensure these settings are correctly configured?

a) In your web browser's settings.

b) In the Git configuration file.

c) By running `git config --global user.name` and `git config --global user.email` commands.

d) In your computer's system preferences.

Answers: 1 c – 2 b – 3 d – 4 d – 5 c