Git & GitHub Course
Git & GitHub
/
Beginner

Installing Git

Definition

The process of downloading and setting up the Git executable on your local operating system (Windows, Mac, or Linux).

Explain Like I'm New

Before you can use Git commands in your terminal, you have to download the program. Mac usually comes with it installed, but Windows users need to download 'Git for Windows' (which also includes a really nice terminal called Git Bash).

Real World Example

Opening your terminal and typing `git --version` to see if it is installed, and what version you are running.

Common Use Cases

  • •Setting up a new developer machine

Terminal Output

bash / terminal
# Check if git is installed $ git --version # Expected output: git version 2.40.1 # If you are on Mac and it says 'command not found', # you can install it using Homebrew: $ brew install git # On Ubuntu/Debian Linux: $ sudo apt-get install git

Interview Questions

basic

  • What command checks if Git is installed?

intermediate

  • What is Git Bash?

Flash Cards

Question

Command to check?

Click to reveal answer
Answer

`git --version`

Question

What is Git Bash?

Click to reveal answer
Answer

It's an application for Windows environments that provides an emulation layer for a Git command line experience. It allows Windows users to use standard Linux/Unix commands like `ls`, `cd`, and `rm`.