Originally published on CodingCush.

To install Git, download the free installer for your operating system from the official site git-scm.com, run it with the default options, then open a terminal and type git --version to confirm it worked. On Mac and Linux you can also install it through the built-in tools described below. The whole job takes about five minutes, and this guide walks through each system one by one.

What Is Git, in One Honest Paragraph?

Git is the version control tool almost every developer on Earth uses to track changes in code. It remembers every version of your project, lets you undo mistakes, work on new ideas safely in branches, and collaborate through sites such as GitHub without emailing zip files called final-project-REALLY-final-v7.zip to yourself. We have all been that person; Git is how you stop being that person.

Before installing, it helps to know that Git and GitHub are two different things — Git is the tool on your computer, GitHub is a website that hosts projects using Git. Our comparison of Git vs GitHub explains that difference clearly if it still feels fuzzy. The good news is that you only install Git once, and every editor, project and tutorial you meet afterwards will quietly assume it is there. The official Git downloads page is the only place this guide will send you for the installer, because downloading developer tools from random mirror sites is a hobby nobody needs.

Install Git on Windows

Windows has the friendliest installer of the three systems. Open the downloads page, choose the Windows build — most people want the 64-bit Git for Windows Setup — and run the downloaded file. The installer asks a surprising number of questions for a five-minute job, but the honest secret is that the default answer is correct for almost every single one of them. Click Next through the screens, keep the default editor and the recommended settings, and finish.

The installer gives you a bonus tool called Git Bash, a terminal window where Git commands behave exactly as they do in tutorials written for Mac and Linux. If you follow guides that show commands starting with a dollar sign, Git Bash is where you type them on Windows. When the installation ends, open Git Bash — or a fresh Command Prompt or PowerShell window, if it was already open, close and reopen it so it notices the new tool — and run the version check from the section below. The official Pro Git book's chapter on installing Git covers the same Windows route with extra detail if any screen looks different on your machine.

Install Git on Mac

Mac gives you three honest routes, and the first is almost embarrassingly simple: open the Terminal app and type git --version. If Git is not installed yet, macOS itself will offer to install the Command Line Developer Tools, which include Git — accept, wait for the download, and you are done. Many Macs already have Git through this route without their owners ever noticing.

The second route is the standalone installer linked from the downloads page, which suits anyone who wants a newer version than the system one. The third route, popular with developers who install many tools, is the Homebrew package manager: run brew install git and later keep it current with brew upgrade git. Whichever route you take, finish with the version check. If two routes both installed Git at different times, do not worry — the terminal simply uses the first one it finds, and for learning purposes any recent version behaves the same.

The official Git homepage on git-scm.com describing Git as a free and open source distributed version control system, with install options for all platforms

The official Git homepage on git-scm.com — the safe place to download Git for Windows, Mac and Linux.

Install Git on Linux

On Linux, Git lives in your distribution's own software repositories, so the system package manager does the work. On Ubuntu and Debian, the two commands below update your package list and install Git in one go:

sudo apt update sudo apt install git 

On Fedora the equivalent is sudo dnf install git, and on Arch Linux it is sudo pacman -S git. The pattern never really changes: ask your package manager politely, with sudo, and it fetches Git and everything Git needs. Linux users occasionally ask about installing from source to get the very latest version; the official book explains that route too, but for learning and everyday development the package manager version is the sensible choice — it also updates itself along with the rest of your system.

Check That Git Is Installed Correctly

Whatever your system, the moment of truth is one short command. Open a terminal — Git Bash on Windows, Terminal on Mac or Linux — and type:

git --version 

If Git answers with something like git version 2.56.0, congratulations: the installation worked, and the exact number does not matter for anything in this guide. If instead you see an error such as "command not found", the usual causes are simple: the terminal was already open during installation and needs restarting, the installer did not finish, or on Windows the PATH option was changed from its default. Restart the terminal first — this one step fixes a genuinely surprising share of "broken" installs — then reinstall with defaults if the error survives.

The Two Settings to Make Immediately

Git stamps every change you save with your name and email, so tell it who you are before your first real project. These two commands, run once, set your identity for every repository on the machine:

git config --global user.name "Your Name" git config --global user.email "you@example.com" 

Use the same email address as your GitHub account if you plan to use GitHub, so your work is linked to your profile correctly. You can check everything Git currently believes about your setup with git config --global --list. Think of this as writing your name inside the cover of a notebook: thirty seconds now, and no confusion later about whose work is whose. With Git installed and named, the natural next step is your first repository — our step-by-step guide to creating a GitHub repository and pushing your first project picks up exactly where this one ends.

Common Installation Problems and Fixes

Problem Likely cause Fix
"git is not recognised" on Windows Terminal was open during install, or PATH was skipped Reopen the terminal; if it persists, reinstall and keep the default PATH option
Mac asks to install developer tools Git is bundled with those tools and is not present yet Accept the prompt and let the tools install, then run the version check again
Linux says the package cannot be found The package list is out of date Run the update command for your system first, then install again
Version is very old An old system copy is found first Install the current version from git-scm.com or your package manager and reopen the terminal

Notice that none of these fixes involve anything dramatic. Git installation problems are almost always about the terminal not knowing where the new tool lives, and a restart or a clean reinstall with default options resolves them. Resist the internet's more creative suggestions until the boring ones have had their chance.

Frequently Asked Questions

Is Git free to download and use?

Yes, completely. Git is free and open source for everyone, including commercial work, and the installers on git-scm.com are the official ones.

Do I need a GitHub account to install Git?

No. Git works fully on your own computer with no account at all. You only need a GitHub account later, when you want to publish or back up your projects online.

How much space and time does installation take?

The Windows installer is a small download and the whole process takes roughly five minutes. Git itself is a lightweight tool that sits quietly until you call it.

Can I use Git without the command line?

Yes — many editors such as VS Code include friendly Git buttons, and graphical Git apps exist. Learning a few basic commands is still worthwhile, because every tutorial and error message assumes them.

Conclusion

Installing Git is a five-minute job with the same shape on every system: get the official installer or package, keep the defaults, verify with git --version, and set your name and email once. From today, every project you build can have a proper history — and the era of the desperately named zip file can officially come to an end.