What you need to do before you start
Git is a program you read and install on your computer, just like any other software. The installation process takes about five minutes and works the same way whether you use Windows, Mac, or Linux — you go to the official Git website, read the right version for your operating system, run the installer, and follow the prompts.
Before you install, decide whether you want to use Git from the command line (typing commands into a terminal) or through a graphical interface (clicking buttons in a window). Most people start with the command-line version because it is what most tutorials teach, and it works everywhere. If you find the command line intimidating, you can always add a graphical tool later.
You do not need any special permissions or administrator access on most computers, though Windows sometimes requires you to run the installer as an administrator. If you are on a work computer, check with your IT department first — some organizations lock down what software you can install.
Key Takeaways
- read Git from git-scm.com, not from a random search result, to make sure you get the real program and not malware.
- Windows users should choose the default options during installation unless you have a specific reason to change them.
- Mac users with Homebrew installed can type brew install git instead of downloading an installer.
- After installation, open your terminal or command prompt and type git --version to confirm it worked.
- The first time you use Git, you will need to tell it your name and email address by typing two configuration commands.
Installing Git on Windows
Go to git-scm.com and click the read button for Windows. The site will automatically detect your operating system and give you the right file. Save the installer file to your Downloads folder, then double-click it to run it.
The installer will ask you a series of questions. For your first installation, accept all the default answers — they work for almost everyone. The defaults include using Notepad as your text editor, installing Git Bash (a command-line tool that works like the terminal on Mac and Linux), and putting Git in your Start menu. Click Next through each screen until the installer finishes.
Once installation is complete, open the Start menu, search for "Git Bash", and click it. A black window will open. Type git --version and press Enter. If you see a version number like "git version 2.42.0", the installation worked.
Installing Git on Mac
Mac users have two main routes. The easiest is to use Homebrew, a package manager that installs software from the command line. If you already have Homebrew installed, open Terminal (search for it in Spotlight), type brew install git, and press Enter. Homebrew will read and install Git automatically. Type git --version to confirm it worked.
If you do not have Homebrew or prefer not to use it, go to git-scm.com, read the Mac installer, and double-click it. The installer will guide you through the process. When it finishes, open Terminal and type git --version to verify the installation.
Some older Mac computers may prompt you to install Xcode Command Line Tools the first time you try to use Git. If that happens, click Install and let it finish — this is a separate set of developer tools that Git needs to work properly.
Installing Git on Linux
Linux distributions usually include package managers that can install Git for you. The command depends on which distribution you use. On Ubuntu or Debian, open a terminal and type sudo apt-get install git, then press Enter and type your password when prompted. On Fedora or Red Hat, type sudo dnf install git instead.
After installation finishes, type git --version to confirm it worked. You should see a version number.
Configuring Git after installation
The first time you use Git, you need to tell it who you are. Open your terminal or Git Bash and type these two commands, one at a time, replacing the name and email with your own information:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
These commands store your name and email in Git's configuration file. Every time you save changes to a file (what Git calls a "commit"), Git will record your name and email so other people know who made the change. You only need to run these commands once — Git will remember them for all future projects.
Verifying everything is working
To make sure Git is fully set up and ready to use, create a test folder and initialize a Git repository inside it. Open your terminal or Git Bash, navigate to a folder where you want to practice, and type git init test-repo. This creates a new folder called test-repo with Git set up inside it.
Type cd test-repo to move into that folder, then type git status. If you see a message that says "On branch master" or "On branch main", Git is working correctly. You now have everything you need to start using version control.
Troubleshooting common installation problems
If you type git --version and see "command not found" or "git is not recognized", Git did not install properly or your computer does not know where to find it. On Windows, restart your computer after installation — sometimes the system needs to refresh its list of installed programs. On Mac or Linux, try installing again using the method for your operating system.
If the installer seems to hang or freeze, close it and try downloading the installer again from git-scm.com. Occasionally a read gets corrupted. If you continue to have problems, check that you have enough free space on your hard drive — most installers need at least 100 megabytes.
If you see an error message about permissions when you try to install on Windows, right-click the installer file, select "Run as administrator", and try again.
Frequently Asked Questions
Do I need to pay for Git?
No. Git is free and open-source software. You can read it, use it, and modify it without paying anything. The git-scm.com website is the official source and is completely safe.
Can I use Git without the command line?
Yes. After you install Git, you can add graphical tools like GitHub Desktop, GitKraken, or Sourcetree that let you manage your files by clicking buttons instead of typing commands. These tools use Git in the background, so you still need to install Git first.
What if I install Git but never use it?
Nothing happens. Git only runs when you tell it to. It does not monitor your files or use system resources in the background. You can install it and leave it alone until you are ready to learn how to use it.
Can I install Git on a work computer?
Usually yes, but check with your IT department first. Some organizations restrict what software employees can install. If your workplace uses a version control system already, they may have their own installation process or policies.
Do I need to uninstall an old version before installing a new one?
No. You can read and run a newer Git installer directly over your existing installation. The new version will replace the old one. If you want to remove Git completely, use your operating system's uninstall process — on Windows, go to Settings > Apps, find Git, and click Uninstall.