How to download git on windows

Download for Windows

Click here to download the latest (2.42.0) 32-bit version of Git for Windows. This is the most recent maintained build. It was released about 1 month ago, on 2023-08-30.

Other Git for Windows downloads

Standalone Installer

32-bit Git for Windows Setup.

64-bit Git for Windows Setup.

Portable («thumbdrive edition»)

32-bit Git for Windows Portable.

64-bit Git for Windows Portable.

Using winget tool

Install winget tool if you don’t already have it, then type this command in command prompt or Powershell.
winget install --id Git.Git -e --source winget

The current source code release is version 2.42.0. If you want the newer version, you can build it from the source code.

Now What?

Now that you have downloaded Git, it’s time to start using it.

  • Read the Book

    Dive into the Pro Git book and learn at your own pace.

  • Download a GUI

    Several free and commercial GUI tools are available for the Windows platform.

  • Get Involved

    A knowledgeable Git community is available to answer your questions.

Install git illustration

How to install Git on any OS

Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

Checking for Git

To see if you already have Git installed, open up your terminal application.

  • If you’re on a Mac, look for a command prompt application called «Terminal».
  • If you’re on a Windows machine, open the windows command prompt or «Git Bash».

Once you’ve opened your terminal application, type git version. The output will either tell you which version of Git is installed, or it will alert you that git is an unknown command. If it’s an unknown command, read further and find out how to install Git.

Install Git Using GitHub Desktop

Installing GitHub Desktop will also install the latest version of Git if you don’t already have it. With GitHub Desktop, you get a command line version of Git with a robust GUI. Regardless of if you have Git installed or not, GitHub Desktop offers a simple collaboration tool for Git. You can learn more here.

Install Git on Windows

  1. Navigate to the latest Git for Windows installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided in the Git Setup wizard screen until the installation is complete.
  3. Open the windows command prompt (or Git Bash if you selected not to use the standard Git Windows Command Prompt during the Git installation).
  4. Type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git for Windows. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git included with the recommended command prompt, Git Bash . The download source is the same Git for Windows installer as referenced in the steps above.

Install Git on Mac

Most versions of MacOS will already have Git installed, and you can activate it through the terminal with git version. However, if you don’t have Git installed for whatever reason, you can install the latest version of Git using one of several popular methods as listed below:

Install Git From an Installer

  1. Navigate to the latest macOS Git Installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided until the installation is complete.
  3. Open the command prompt «terminal» and type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git on a Mac. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git. The download source is the same macOS Git Installer as referenced in the steps above.

Install Git from Homebrew

Homebrew is a popular package manager for macOS. If you already have Homwbrew installed, you can follow the below steps to install Git:

  1. Open up a terminal window and install Git using the following command: brew install git.
  2. Once the command output has completed, you can verify the installation by typing: git version.

Install Git on Linux

Fun fact: Git was originally developed to version the Linux operating system! So, it only makes sense that it is easy to configure to run on Linux.

You can install Git on Linux through the package management tool that comes with your distribution.

Debian/Ubuntu

  1. Git packages are available using apt.
  2. It’s a good idea to make sure you’re running the latest version. To do so, Navigate to your command prompt shell and run the following command to make sure everything is up-to-date: sudo apt-get update.
  3. To install Git, run the following command: sudo apt-get install git-all.
  4. Once the command output has completed, you can verify the installation by typing: git version.

Fedora

  1. Git packages are available using dnf.
  2. To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all.
  3. Once the command output has completed, you can verify the installation by typing: git version.

Note: You can download the proper Git versions and read more about how to install on specific Linux systems, like installing Git on Ubuntu or Fedora, in git-scm’s documentation.

Other Methods of Installing Git

Looking to install Git via the source code? Learn more here.

Contribute to this article on GitHub.

Get started with git and GitHub

Review code, manage projects, and build software alongside 40 million developers.

Sign up for GitHub

Sign in

Introduction

Git is a widely used open-source software tracking application used to track projects across different teams and revision levels.

This guide will show you how to install Git on Windows.

tutorial on Installing Git Windows

Prerequisites

  • Administrator privileges
  • Access to a command-line
  • Your favorite coding text editor
  • Username and password for the Github website (optional)

Steps For Installing Git for Windows

Installing Git prompts you to select a text editor. If you don’t have one, we strongly advise you to install prior to installing Git. Our roundup of the best text editors for coding may help you decide.

Note: If you are new to Git, refer to our post How Does Git Work to learn more about Git workflow and Git functions.

Download Git for Windows

1. Browse to the official Git website: https://git-scm.com/downloads
2. Click the download link for Windows and allow the download to complete.

Windows version on Git page to download

Extract and Launch Git Installer

3. Browse to the download location (or use the download shortcut in your browser). Double-click the file to extract and launch the installer.

 example Location where the Git file has been downloaded

4. Allow the app to make changes to your device by clicking Yes on the User Account Control dialog that opens.

Initiate the Git installation process by selecting Yes

5. Review the GNU General Public License, and when you’re ready to install, click Next.

Accept Git Terms of Use

6. The installer will ask you for an installation location. Leave the default, unless you have reason to change it, and click Next.

Select the location for the Git installation on windows

7. A component selection screen will appear. Leave the defaults unless you have a specific need to change them and click Next.

This screen allows you to select custom Git componenets to install.

8. The installer will offer to create a start menu folder. Simply click Next.

Create shortcuts in Windows Start Menu

9. Select a text editor you’d like to use with Git. Use the drop-down menu to select Notepad++ (or whichever text editor you prefer) and click Next.

choosing a text editor durring Git installation

10. The next step allows you to choose a different name for your initial branch. The default is ‘master.’ Unless you’re working in a team that requires a different name, leave the default option and click Next.

Choose a name for your initial git branch.

11. This installation step allows you to change the PATH environment. The PATH is the default set of directories included when you run a command from the command line. Leave this on the middle (recommended) selection and click Next.

Adjust Git path enviorment

Server Certificates, Line Endings and Terminal Emulators

12. The installer now asks which SSH client you want Git to use. Git already comes with its own SSH client, so if you don’t need a specific one, leave the default option and click Next.

Choose which SSH client to use in git.

13. The next option relates to server certificates. Most users should use the default. If you’re working in an Active Directory environment, you may need to switch to Windows Store certificates. Click Next.

server sertificate for Git to use selcted

14. The next selection converts line endings. It is recommended that you leave the default selection. This relates to the way data is formatted and changing this option may cause problems. Click Next.

Select line end conversions

15. Choose the terminal emulator you want to use. The default MinTTY is recommended, for its features. Click Next.

Select MinTTY as default terminal emulator

16. The installer now asks what the git pull command should do. The default option is recommended unless you specifically need to change its behavior. Click Next to continue with the installation.

Choose what the git pull command does in git.

17. Next you should choose which credential helper to use. Git uses credential helpers to fetch or save credentials. Leave the default option as it is the most stable one, and click Next.

Choose a git credential helper.

Additional Customization Options

18. The default options are recommended, however this step allows you to decide which extra option you would like to enable. If you use symbolic links, which are like shortcuts for the command line, tick the box. Click Next.

Choose extra options during git installation.

19. Depending on the version of Git you’re installing, it may offer to install experimental features. At the time this article was written, the options to include support for pseudo controls and a built-in file system monitor were offered. Unless you are feeling adventurous, leave them unchecked and click Install.

Configure experimental git features.

Complete Git Installation Process

20. Once the installation is complete, tick the boxes to view the Release Notes or Launch Git Bash, then click Finish.

Git installation on Windows is done

How to Launch Git in Windows

Git has two modes of use – a bash scripting shell (or command line) and a graphical user interface (GUI).

Launch Git Bash Shell

To launch Git Bash open the Windows Start menu, type git bash and press Enter (or click the application icon).

how to start Git bash from Windows

Launch Git GUI

To launch Git GUI open the Windows Start menu, type git gui and press Enter (or click the application icon).

initial Git GUI screen

Connecting to a Remote Repository

You need a GitHub username and password for this next step.

Create a Test Directory

Open a Windows PowerShell interface by pressing Windows Key + x, and then i once the menu appears.

Create a new test directory (folder) by entering the following:

mkdir git_test

An example of the PowerShell output.

Example of creating a test directory in Windows PowerShell.

Change your location to the newly created directory:

cd git_test

Note: If you already have a GitHub repository, use the name of that project instead of git_test.

Configure GitHub Credentials

Configure your local Git installation to use your GitHub credentials by entering the following:

git config --global user.name "github_username"
git config --global user.email "email_address"

Note: Replace github_username and email_address with your GitHub credentials.

Clone a GitHub Repository

Go to your repository on GitHub. In the top right above the list of files, open the Clone or download drop-down menu. Copy the URL for cloning over HTTPS.

Cloning a GitHub repository over HTTPS

Switch to your PowerShell window, and enter the following:

git clone repository_url

Important: In the example above, the command will clone the repository over HTTPS. Another option is cloning with SSH URLs. For that option to work, you must generate an SSH key pair on your Windows workstation and assign the public key to your GitHub account.

List Remote Repositories

Your working directory should now have a copy of the repository from GitHub. It should contain a directory with the name of the project. Change to the directory:

cd git_project

Note: Replace git_project with the actual name of the repository you downloaded. If it’s not working, you can list the contents of the current directory with the ls command. This is helpful if you don’t know the exact name or need to check your spelling.

Once you’re in the sub-directory, list the remote repositories:

git remote -v

Pushing Local Files to the Remote Repository

Once you’ve done some work on the project, you may want to submit those changes to the remote project on GitHub.

1. For example, create a new text file by entering the following into your PowerShell window:

new-item text.txt

2. Confirmation that the new file is created.

Create new text file in Windows PowerShell.

3. Now check the status of your new Git branch and untracked files:

git status

4. Add your new file to the local project:

git add text.txt

5. Run git status again to make sure the text.txt file has been added. Next, commit the changes to the local project:

git commit -m "Sample 1"

6. Finally, push the changes to the remote GitHub repository:

git push

You may need to enter your username and password for GitHub.

Note: You can remove a remote repository if the need for it no longer exists. To learn how, visit our guide How to Remove a Git Remote.

Conclusion

You now have a working installation of Git on your Windows system. After installing Git on your Windows, you might find helpful how to update Git. Use Git’s features to coordinate work among programmers on a project.

For Linux and MacOS installation guides, check out our articles on installing Git on Ubuntu,  CentOS and MacOS.

Введение

В этой инструкции покажем, как установить Git на Windows, и поможем выбрать правильные параметры при установке. Затем создадим репозиторий и зафиксируем в нем изменения. Все это поможет вам сделать первые шаги в освоении Git.

Что такое Git и зачем он нужен

Git — это одна из самых популярных систем контроля версий (VCS). Такие системы помогают разработчикам хранить и версионировать исходный код приложений, настройки систем и другие текстовые файлы. И хотя ничего не мешает использовать VCS в других областях, чаще всего они применяются именно в IT.

Каждое состояние файлов в Git можно зафиксировать (сделать коммит), причем это навсегда останется в истории репозитория. Поэтому можно в любой момент посмотреть историю изменений файлов, сравнить различные версии и отменить отдельные изменения.

Также Git упрощает ведение параллельной разработки несколькими членами команды. Для этого используется ветвление. Условно можно сказать, что в Git-репозитории есть одна основная ветка, в которой хранится текущая стабильная версия исходного кода. Когда разработчик хочет изменить этот код, он «откалывает» себе отдельную ветку от основной и работает в ней. Когда работа закончена, он «вливает» изменения в основную ветку, чтобы его доработками смогли воспользоваться другие члены команды.

На самом деле все это описание довольно грубое, и по работе с Git можно написать не одну статью. На официальном сайте Git есть бесплатная электронная книга, в том числе она переведена на русский язык. А в этой статье мы сосредоточимся на установке Git в Windows и его первоначальной настройке.

Установка Git в Windows

Переходим на официальный сайт Git, в раздел загрузок. Мы увидим несколько вариантов установки: разные разрядности, портативная версия и даже установка из исходников. Мы выберем Standalone-версию, для этого проще всего нажать ссылку Click here to download, она всегда ведет на самую актуальную версию. Запускаем скачанный файл.

Выбор компонентов. Первый экран — выбор компонентов для установки. Если вам нужны дополнительные иконки на рабочем столе, или если вы хотите, чтобы Git ежедневно проверял наличие новой версии, — отметьте соответствующие опции. Остальные параметры лучше оставить по умолчанию.

параметры установки

Текстовый редактор по умолчанию. Необходимо выбрать редактор, который будет использовать Git — например, когда вы будете писать сообщение для коммита. Это не обязательно должен быть редактор, в котором вы планируете писать исходный код.

По умолчанию в установщике выбран Vim — консольный текстовый редактор, который для многих может показаться сложным в освоении. Если вы не знакомы с Vim и при этом хотите именно консольный редактор — выберите nano. Если у вас уже установлен какой-нибудь текстовый редактор — выбирайте его. Мы для примера будем использовать VSCode.

выбор текстового редактора

Название первой ветки. Тут нужно выбрать, как Git будет называть первую ветку в каждом репозитории. Раньше такая ветка всегда называлась master, но со временем это стало напоминать о временах рабства, и многие проекты и компании стали переименовывать ветки в своих репозиториях. Поэтому разработчики Git добавили эту опцию, чтобы название первой ветки можно было изменить. Мы будем придерживаться старого поведения и оставим название master.

название первой ветки

Способ использования Git. Первая опция сделает Git доступным только из командной строки Git Bash. Это не очень удобно, потому что не позволит пользоваться Git-ом из других оболочек или интегрировать его с редактором кода. Вторая опция самая оптимальная (ее мы и выберем) — она позволяет работать с Git-ом из разных оболочек и интегрировать его с другими приложениями. Третья опция кроме установки Git также «перезапишет» некоторые системные команды Windows аналогами из Unix, и эту опцию нужно выбирать только если вы точно понимаете, что делаете.

способ использования git

Выбор SSH-клиента. Изначально Git поставлялся со встроенным SSH-клиентом, но недавно появилась опция, где можно использовать внешний клиент. Если у вас уже что-то установлено на компьютере — можете выбрать вторую опцию. Мы же остановимся на первой, так как предварительно ничего не устанавливали.

выбор ssh-клиента

Выбор SSL/TLS библиотеки. По умолчанию Git будет использовать свою OpenSSL библиотеку с заранее определенным списком корневых сертификатов. Обычно этого достаточно, но если вам нужно работать со внутренними репозиториям внутри компании, которые используют самоподписанные сертификаты, выберите вторую опцию. Тогда Git будет использовать библиотеку и сертификаты из вашей операционной системы.

выбор SSL/TLS библиотеки

Символы перевода строки. Существует два основных способа формирования конца строки в файлах — CRLF и LF. Первый используется в Windows, второй — в Unix-like системах. Первая опция позволяет извлекать файлы из репозитория в Windows-стиле, при этом отправлять файлы в репозиторий в Unix-стиле. Мы рекомендуем использовать этот вариант, потому что он лучше всего подходит для кросс-платформенной команды, когда над одним кодом могут работать разработчики на разных ОС.

символ перевода строки

Эмулятор терминала. Эмулятор, который будет использоваться в командной строке Git Bash. MinTTY — удобный вариант, поэтому он выбран по умолчанию. Встроенный эмулятор CMD не очень удобен, у него есть некоторые ограничения, поэтому выбирайте его, только если делаете это осознанно.

эмулятор терминала

Стратегия git pull. Первая опция будет пытаться обновить историю коммитов без создания коммитов слияния. Это самый оптимальный и часто используемый вариант, оставим его.

стратегия git pull

Credential Manager. Установка этого параметра позволит Git запоминать логины и пароли для подключения к удаленным репозиториям (например, GitHub, GitLab или корпоративное хранилище) и не вводить их постоянно.

Credential Manager

Дополнительные настройки. Кэширование позволит ускорить работу Git, эту опцию рекомендуем оставить. А вот символические ссылки нам не нужны.

дополнительные настройки

Экспериментальные настройки. Эти опции еще не переведены в стабильную стадию, поэтому их использование рекомендуется, только если вы точно понимаете, что делаете. Мы не будем ничего отмечать.

экспериментальные настройки

Git установлен и готов к работе.

Установка в различные дистрибутивы Linux

Также коротко покажем, как можно установить Git в различные дистрибутивы Linux. Как правило, самостоятельно скачивать ничего не нужно, достаточно воспользоваться встроенным в дистрибутив пакетным менеджером.

Debian

pt-get install git

Ubuntu

add-apt-repository ppa:git-core/ppa # apt update; apt install git

Fedora 21

yum install git

Fedora 22+

dnf install git

Gentoo

emerge --ask --verbose dev-vcs/git

Arch Linux

man -S git

OpenSUSE

ypper install git

Mageia

rpmi git

FreeBSD

pkg install git

OpenBSD

g_add git

RHEL, CentOS, Oracle Linux и др.

Как правило, пакетный установит довольно старую версию Git, поэтому рекомендуется собирать Git из исходных кодов, или воспользоваться сторонним репозиторием IUS Community.

Первоначальная настройка и создание репозитория

Перед началом работы с Git нужно указать свое имя и email, которые в дальнейшем будут записываться в историю изменений при каждом коммите. В будущем это позволит понять, кто именно внес те или иные изменения.

Откроем любое из приложений — Git Bash или Git CMD. Первое — это командная строка в стиле Linux, второе — командная строка в стиле Windows. Выбирайте то, что вам ближе. Мы выберем Git Bash и выполним две команды:

git config --global user.email "git-user@selectel.ru"
git config --global user.name "Selectel Git User"

Теперь Git полностью готов к работе. Давайте создадим репозиторий и зафиксируем в нем первое изменение (сделаем коммит). Для начала создадим каталог для будущего репозитория и сразу перейдем в него:

mkdir first-repo && cd first-repo

Создаем новый репозиторий в этом каталоге:

git init

Увидим ответ:

Initialized empty Git repository in C:/Users/git_user/first-repo/.git/.

Это означает, что в директории создан новый репозиторий. Далее создадим текстовый файл, назовем его README.md, и напишем в нем любой текст. Но сам по себе этот файл не попадет в следующий коммит. Мы должны проиндексировать изменения, то есть явно сказать Git-у, что этот файл нужно учитывать в следующем коммите:

git add README.md

Далее введем команду:

 git commit

Откроется текстовый редактор, который мы выбирали на этапе установки Git. Тут нам нужно ввести комментарий для коммита, то есть кратко описать изменение, которое мы сделали. Мы напишем такой комментарий:

комментарий в текстовом редакторе

Обратите внимание, что Git автоматически добавил небольшую подсказку в это окно. При этом она не войдет в коммит, потому что в начале строки стоит символ решетки, и Git проигнорирует ее. Но она может быть полезна для дополнительной проверки: мы видим название текущей ветки и список файлов, которые войдут в коммит.

Сохраним файл и закроем редактор. Увидим примерно следующее сообщение:

[master (root-commit) 2b8f7a5] Add readme file
 1 file changed, 3 insertions(+)
 create mode 100644 README.md

Мы успешно сделали первый коммит.

Работа с Git в визуальном интерфейсе

Сам по себе Git — это утилита командной строки. Но не всем может быть удобно запоминать и писать команды в терминале, поэтому часто разработчики пользуются графическим интерфейсом. Есть несколько вариантов:

  • Встроенный GUI. В базовой установке Git есть две простые утилиты: gitk и git gui. Но у них довольно старый интерфейс и пользоваться ими не всегда удобно.
  • Отдельные графические утилиты. Они могут быть понятны и красивы, но неудобны тем, что код нужно писать в одной программе, а для работы с Git нужно переключаться в другую. Примеры таких программ: GitKraken, Sourcetree, GitAtomic. Большой список таких клиентов есть на официальном сайте Git.
  • Встроенные в IDE или текстовый редактор. В большинстве популярных редакторов кода или IDE уже есть поддержка Git. Как правило, ничего дополнительно настраивать не нужно. Мы рассмотрим именно такой вариант на примере редактора VSCode.

Откроем директорию с репозиторием в редакторе VSCode. Внесите любое изменение в файл README.md и сохраните изменения. Обратите внимание, что в левой части редактора кое-что изменилось:

сохранение изменений в readme

  1. Файл README.md подсветился желтым цветом, а рядом с ним появилась буква M (означает Modified — изменен).
  2. На панели Source Code появилась цифра 1, означающая, что есть одно изменение, которое можно зафиксировать.

Перейдем на панель Source Code. Слева находится список файлов, которые были изменены. Если кликнем на файл, то увидим какие именно изменения мы внесли: в этом случае добавили новую строчку This is the second commit.

просмотр изменений в файле

Теперь давайте зафиксируем наши изменения. Рядом с названием файла нажмем на «плюс», чтобы проиндексировать его. Это аналогично команде git add, которую мы выполняли ранее. Затем в поле Message внесем комментарий и нажмем кнопку Commit. Это аналогично команде git commit.

Поздравляем, вы сделали уже два коммита в свой репозиторий!

Заключение

Итак, мы рассмотрели процесс установки Git под Windows, рассказали об основных параметрах установки и последующей настройки. Увидели, как репозиторий и внести в него первый коммит. Познакомились с работой в командной строке и с помощью графического интерфейса.

To start using Git, you’ll first need to download Git for your operating system. In this article, we’ll cover how to download Git for Windows, Mac, and Linux. You’ll also learn how to configure Git with your identity so you can start working on your first Git project. 

Download Git for Your Operating System

Download Git for Windows

Download Git for Mac

Install Git for Linux

Configure Git with Your Identity

Git Download FAQs

Key Terms & Resources

Git is a distributed version control system (VCS) created by Linus Torvalds in 2005. Git is used to track changes made to files in a project and allows users to revert to previous versions of their project. Git has quickly become the most popular version control system because of its distributed model, branching, speed, and more.

Git SCM – This is Git’s official website. This resource provides content about what Git is, documentation regarding how to use Git, and ways to connect and network with the Git community. 

The Pro Git Book – Often simply referred to as “The Git Book”, this contains explanations for Git’s commands and functionality. The Git Book is extremely detailed and is written in technical language, so beginners may find its material somewhat confusing. The content in the Git Book becomes easier to understand as you get hands on experience with Git, but it is important to know that the Git Book exists, as we will use it to configure Git on your machine after your Git download. 

Edward Thomson’s talk at the GitKon Git conference provides additional information about the progression of version control and the history of Git. 

Want to try working with Git before downloading it? You can do just that with GitKraken Client! Run Git commands, experiment with the CLI, and get a feel for a Git workflow without ever having to download Git.

How to Download Git for Windows

To download Git for Windows, you’ll first need to navigate to the Git download for Windows page on Git SCM. Next, you’ll need to find out if your machine is 32 or 64-bit. To determine whether your machine is 32 or 64-bit, simply type 32 or 64 bit into the Start menu (usually found on the bottom left of your screen) and hit enter

This will open an About menu on your computer and show if your machine is 32 or 64-bit. Next, select the option that matches your system–32-bit Git for Windows Setup or 64-bit Git for Windows Setup–to begin the Git download for Windows process. 

Git Download for Windows Setup

As Git begins to download, you will be met with several setup options that appear automatically. For most of the setup options, you can simply accept the default settings, with one exception. 

Select Next through the initial setup options until you get to the option titled Adjusting the name of the initial branch in new repositories.

From here, select the option that reads Override the default branch name for new repositories and type main in the text box just below.

This makes it so any time you create a new repository, your initial Git branch will be called main instead of master. Changing your default branch name to main is an accepted tech industry standard. Take a look at this article for more information about the change from master to main. 

From here, you can continue to accept the default setup by selecting Next through the remainder of the options. You’ll know that you’ve come to an end to the setup options when you are presented with an option to Install

Select Install and a status bar will appear showing the progress of your Git download. Completing your Git download for Windows can take anywhere from 1-5 minutes depending on your Internet connection. Once the Git download status bar is filled, you should have Git downloaded for Windows on your computer. 

Verify your Git Download for Windows

To double check that Git has been properly downloaded to your machine, navigate to a terminal, such as the GitKraken CLI, and run git –version. Your terminal should return this message: git version #.##.#

Congratulations! Now that your Git download for Windows is complete, jump to the bottom of this article for a guide to configuring Git and tips for accelerating your Git knowledge.

How to Download Git for Mac

To download Git for Mac on your Apple Machine, navigate to the MacOS Git Download page on Git SCM. You will first need to install Homebrew before you can download Git for Mac. Homebrew is a package manager that makes it easy to install and update software packages. To install Homebrew, select the Homebrew link at the top of the Git SCM page. Now, from the Homebrew page, copy the string of code found just beneath the title, Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Next, navigate to your terminal of choice and paste the code you copied from the Homebrew page. This will automatically start installing Homebrew on your machine. 

Depending on your computer settings, you may have to enter your computer password before Homebrew installs. You’ll know that Homebrew has installed when the following message is returned in your terminal: Installations successful

Download Git for Mac with Homebrew

Once Homebrew is installed, navigate back to the MacOS Git download page on Git SCM. From here, copy the code found just beneath the Homebrew title: ​​$ brew install git. Paste that code into your terminal and hit return; this will begin your Git download for Mac. 

Once your Git download is complete, the terminal will return a message that looks like the  following: Summary 🍺  /usr/local/Cellar/git/#.##.#.. This is simply a download summary that Homebrew provides that tells you that your Git download was successful, and shows you the location of your Git download on your machine.

Verify your Git Download for Mac

To double check that Git has been properly downloaded to your machine, navigate to a terminal and run git –version. Your terminal should return this message: git version #.##.#

Congratulations! Now that your Git download for Mac is complete, jump to the bottom of this article for a guide to configuring Git and tips for advancing your knowledge of Git.

How to Install Git for Linux

Installing Git on Linux is quite simple. In fact, many Linux systems already have Git installed by default. 

To confirm whether or not your computer already has Git downloaded, open a terminal and type: git –version. If Git is already installed, your terminal will return something like: git version 2.36.1. If your machine doesn’t have Git installed, the terminal will return an error message. 

The easiest way to download Git on your Linux system is to use the preferred package manager of your particular distribution. While the specific commands to download Git on Linux systems are different, the process for downloading Git is very similar. 

First, update your package list, and then download the most recent version of Git supported by your system. Let’s take a look at what that looks like for the most popular Linux distributions. 

How to Install Git on Ubuntu / Debian

To install Git for Ubuntu, run these commands from your terminal:

Update System Package List:

sudo apt-get update

Installing Git in Ubuntu / Debian: 

apt-get install git

Install Git on Fedora

To install Git on Fedora, run these commands from your terminal:

Update System Package List:

sudo dnf -y update

Install Git on Fedora:

sudo dnf -y install git

Gentoo Install Git

To install Git on Gentoo, run these commands from your terminal:
Update System Package List:

emerge -avDuN world

Install Git on Gentoo:

emerge --ask --verbose dev-vcs/git

Install Git on Arch Linux

To install Git on Arch Linux, run these commands from your terminal:

Update System Package List:

sudo pacman --sync --refresh --sysupgrade

Install Git on Arch Linux:

pacman -S git

Confirm your Git Installation on Linux

Once you’ve run the code specific to your package manager to download Git on Linux, you’ll want to  confirm that your Git installation on Linux was successful. To make sure Git has been properly downloaded on your machine, navigate to a terminal and type: git –version. Your terminal should return this message: git version #.##.#

Configure Git for your Operating System

Before you start using Git to track your projects, you’ll need to configure your identity. You must configure your identity because, as the Pro Git Book states, “every Git commit uses this information, and it’s immutably baked into the commits you start creating”. To configure your identity, you’ll need to open a terminal and run the following commands:

Configure your Username:

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

Configure your Email:

git config --global user.email [email protected]

Configure your Default Branch Name to Main (Mac and Linux only):

git config --global init.defaultBranch main

You can verify that you have configured Git properly by running git config –list. If configured correctly, the terminal will return your username, email, and default branch name as you entered them above. 

Git Download FAQs

Q: How to Download From Git

A: Git is software that runs locally on your machine once you download Git. Select your operating system at the top of this article to download Git for Windows, Mac, or Linux.

Q: How to Download With Git

A: Git can be downloaded from the official Git site, Git SCM.

Git can have a steep learning curve. Complete with autosuggest and autocomplete Git commands, visual commit graph, integrated terminal, and more, GitKraken Client makes Git easier and more intuitive.

Accelerate Your Progress with GitKraken’s Learn Git Resources

Now that you have Git downloaded and configured, you can start working on your first Git project! As you work with Git and get involved in contributing to projects, you’ll discover a vibrant community of developers, academics, gamers, geniuses, and everything in between. 

If you want to accelerate your progress so you can start making meaningful contributions at your job or open source projects, take a look at GitKraken’s Learn Git resources. Complete with Git tutorials, definitions, best practices, and more, GitKraken’s Learn Git library is completely free and is sure to help you take your Git skills to the next level.

  • How to downgrade windows 11 to windows 10
  • How to delete windows defender 10
  • How to connect ubuntu to windows
  • How to change user folder name windows 11
  • How to disable windows update in windows 10