Git for windows desktop

Download for Windows

Click here to download
the latest (2.49.0)
x64 version of Git for Windows.
This is the most recent maintained build.
It was released on 2025-03-17.

Other Git for Windows downloads

Standalone Installer

Git for Windows/x64 Setup.

Git for Windows/ARM64 Setup.

Portable («thumbdrive edition»)

Git for Windows/x64 Portable.

Git for Windows/ARM64 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.49.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.

Focus on what matters instead of fighting with Git. Whether you’re new
to Git or a seasoned user, GitHub Desktop simplifies your development
workflow.

Download for macOS
Download for Windows (64bit)

Try beta features and help improve future releases

Experience the latest features and bug fixes before they’re released.

Check out Beta

Do you use an Apple silicon Mac?

See the Apple docs about Apple vs Intel chips.

Download for Apple silicon Mac

Looking for Windows?

Need to download the install for Windows?

Download for Windows

Prefer the MSI?

Need to download the package to install across your organization?

Download for Windows (MSI)

Mac?

Need to download for macOS?

Download for macOS

By downloading, you agree to the Open Source Applications Terms.

Last Updated :
06 Dec, 2024

Git is a powerful version control system used by developers worldwide. If you’re looking to set up Git on your Windows machine, you have several options. This article will walk you through the most reliable and effective methods for installing Git on Windows, ensuring you stay up to date with the latest versions and updates.

Prerequisites

Before you begin, make sure your system meets the following requirements:

  • A Windows PC (Windows 7 or newer).
  • An internet connection to download the Git installer.

Table of Content

  • Method 1: Install Git using the Official Git for Windows Installer
  • Method 2: Install Git Using Chocolatey Package Manager
  • Method 3: Install Git Using Windows Subsystem for Linux (WSL)
  • Method 4: Install Git via GitHub Desktop

How to Install Git on Windows — 4 Methods

We will walk you through each step of the installation process and provide helpful tips to get you started with Git on your Windows machine.

Method 1: Install Git using the Official Git for Windows Installer

The easiest and most recommended way to install Git on Windows is through the official Git for Windows installer. This method provides the most up-to-date version and ensures that Git runs smoothly on your system.

Step 1: Download the Installer

Go to the official Git website: https://git-scm.com/download/win.

gitwindows0

GIT

The download will start automatically for the latest version of Git for Windows. After the download is complete, run the .exe file.

Step 2: Select Editor & Adjust Path

Follow the prompts in the setup wizard. Most default settings will be fine for general use, but here are some key steps:

  • Firstly, the installer will ask which text editor to use for Git. You can choose from options like Vim, Notepad++, or Visual Studio Code.
  • Make sure you choose the option that adds Git to your system PATH (recommended for ease of use in the command line).
  • Select the default option (OpenSSL) to allow Git to communicate securely over HTTPS.
  • The default choice, “Checkout Windows-style, commit Unix-style line endings,” is ideal for most developers working in Windows environments.

Step 3: Complete the Installation

After configuring the setup, click «Install» and allow the installation to complete.

Once done, you can launch Git Bash (installed with Git) or use Git from the Command Prompt (cmd) by typing the following command.

git --version
verify2

Verify

Method 2: Install Git Using Chocolatey Package Manager

Chocolatey is a package manager for Windows that makes it easy to install software using simple commands. You can install Git using Chocolatey if you prefer using command-line tools to manage your software.

Step 1: Install Chocolatey (if not already installed)

Open PowerShell as Administrator.

powershell-as-admin

Admin

Run the following command to install Chocolatey:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Step 2: Install Git

After installing Chocolatey, use the following command to install Git:

choco install git
choco2

Choco

Chocolatey will download and install the latest version of Git on your system.

Step 3: Verify Installation

Open Command Prompt or PowerShell and type the following command to confirm the installation.

git --version
verify2

GIT Version

Method 3: Install Git Using Windows Subsystem for Linux (WSL)

Windows Subsystem for Linux (WSL) allows you to run a Linux distribution alongside your Windows environment. If you’re using WSL, you can install Git as you would on a native Linux system.

Step 1: Install WSL

Open PowerShell as Administrator and run the following command to install WSL:

wsl --install
wsl91

WSL

Restart your PC when prompted.

Step 2: Install Git within WSL

Once WSL is set up, open the WSL terminal (Ubuntu or your preferred Linux distribution).

Use the following command to install Git:

sudo apt update
sudo apt install git
wslnew1

sudo apt

Step 3: Verify Installation

In your WSL terminal, type the following command to verify the installation.

git --version 

Method 4: Install Git via GitHub Desktop

GitHub Desktop provides a graphical interface for managing your Git repositories, which is great for beginners or those who prefer not to work with the command line. You can install Git through GitHub Desktop, which includes Git along with additional features for managing GitHub repositories.

Step 1: Download GitHub Desktop

Visit the GitHub Desktop website and download the installer for Windows.

winn3333

Official Website

Step 2: Run the Installer

Open the installer and follow the on-screen instructions to complete the installation.

winnnn1

Installation

Step 3: Verify Git Installation

After installation, you can verify Git by opening the GitHub Desktop application, or you can open Git Bash or Command Prompt and type

git --version
verify2

Verify

Conclusion

Installing Git on Windows is a straightforward process, and you have multiple methods to choose from. Whether you prefer using an installer, a package manager like Chocolatey, or even WSL for a Linux-like experience, these methods ensure that you can quickly set up Git on your Windows PC. Always make sure to keep your Git installation up to date for the latest features and security patches.

Введение

В этой инструкции покажем, как установить 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 и сохраните изменения. Обратите внимание, что в левой части редактора кое-что изменилось:

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

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

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

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

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

Заключение

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

Getting started with GitHub can be tough. Using Git on the command line can feel daunting, and it’s only natural to yearn for a simple graphical interface 🖥️ rather than odd commands. In this post, we’ll show absolute beginners how to download GitHub GUI for Windows, clone a repo, and push/pull changes. 

📋 Contents

  • ⚙️ Download & Install Github Desktop
  • 🚀 Create and Publish Your First Repository
  • ➕ Create, Commit & Push Files with GitHub Desktop GUI
  • 📂 Clone a Repo with Github Desktop

Download & Install Github Desktop

1️⃣ Get the Windows Installer

Go to the link for Download Github Desktop and click the download button to begin the process. 

Download Github Desktop For Windows

2️⃣ Sign in to your Github account

Once the install has launched, you will need to sign in to Github or create an account if you don’t have one already. 

Github Desktop Install sign in step screenshot

3️⃣ Give GitHub Desktop Permission

When the permissions dialog appears, leave the defaults enabled so GitHub Desktop has full access to your public and private repositories. Otherwise, you’ll run into errors trying to clone private repos later. In future it  probably isn’t a bad idea to learn about ssh-keys for auth in the event you ever want to clone a private git repo from a server but to keep things simple , we will just tick the defaults shown below. 

Github Desktop Insall Permissions dialog step Screenshot

4️⃣ Configure Github Desktop

Sign in using your GitHub username and email address. This will sync your repositories and settings automatically—honestly not sure what the other settings do, I have never needed them. If you do need to change anything later, head to File → Options

Installation is now complete! 🔥 Hopefully that was pretty easy! You should now see something like the window below with your Github Repos, if you don’t have any yet, read on and we will show how to make your first repo. 

Github Desktop Install Final Successful Image


Create and Publish Your First Repository with GitHub Desktop GUI

1️⃣ Click on the File Menu on Top Left 

Select New Repository ⬇️

Navigate to Create New Repository Section for Github Desktop

2️⃣Give your Repo a Name & Description 

Enter a unique name (and an optional description) for your new repo. The Local path setting tells GitHub Desktop where to store your files on your PC—unless you have a specific folder in mind, the default location is fine for now. Click on create repository button once you are satisfied with your choices. 

3️⃣Check it is in the local folder 

GitHub Desktop will automatically create a GitHub folder in your Documents. To check that the repo we created with the gui exists 

➡️ Open 📂 File Explorer

➡️ Go to Documents/GitHub

➡️ You should see the repo you just created in the list

4️⃣Publish from Local Folder to Github

This step is straightforward—click the Publish repository button to upload your local files to GitHub 🤘

If you want to keep your code private, tick the Keep this code private checkbox 🔒

Once that’s done, you’ll find your new repo on your GitHub profile—though it’ll be empty at first! But fear not, in the next step we’ll walk through how to add new files, commit them and push to github —all via the GUI


Create, Commit & Push Files with GitHub Desktop GUI

In this section, we’ll walk through the core Git workflow in GitHub Desktop: create or edit files locally, commit your changes, and push them to the remote repository.

Github Desktop Common Work Flow Diagram

Heads up—you’ll need an code editor installed to follow along with the next steps, I personally use & recommend VS Code as its free and not too painful to set up + works very well with Github Desktop. Notice the Options link below, where you can change the default code editor Github Desktop uses. Then click on the button to open your repo! 

Open Github Repo With Desktop Application

1️⃣Create Files

I created a hello_world.py ⬇️

print("Hello, world!")
print("From my first GitHub repo")

And a hello_world.js ⬇️

console.log("Hello, world!");
console.log("From my first GitHub repo");

So my editor currently looks like the image shown below ⬇️

Creating Python & JS Files to Commit to GIthub Desktop Screenshot

2️⃣Commit Files

This is where the real magic starts! If you go back to the Github GUI , you will see Github Desktop has noticed we made changes to the folder! 

Commit Files to Github Desktop Repo

➡️Ensure that the files you want to commit have the checkmark ticked beside them ☑️

➡️Add a commit message : In mine shown above I have called it ‘Commit Hello worlds’

➡️Optional Description: Here you can add more details , I just listed the files as shown above. 

➡️ Click on the Commit to main button to add the files to version control. 

And that’s it, pretty simple right! Now let’s move on to make sure we send the new files to Github. 

3️⃣Push Files to Github

This step is a very easy—just click the Push origin button (shown below), and GitHub Desktop will publish the files you committed in step 2 directly to your GitHub repository!

And sure enough they are there along with the commit message we wrote in step 2. 

And that’s it for this part. It’s a good idea to practise modifying, committing and pushing a few times, as you’ll be doing this workflow quite often!


Clone a Repo with Github Desktop

Cloning a repository means creating a full local copy of a project hosted on GitHub, so you can browse, edit, and experiment on your own machine. What’s cool about GitHub and open source in general is that you can take someone else’s code, download it directly, and modify it however you like (license permitting, of course).

For this section, we will clone a repo I createed in a post about Deploying a FastAPI app , you can also find the repo here on github

Steps to Clone the Repo 

1️⃣ Navigate to Github Repo on Website 
To follow along with me My Repo link , or whatever repo you are interested in. 
2️⃣Copy the repo URL
3️⃣ Click on File Menu in Github Desktop & Select Clone Repository

4️⃣ Copy Pasting URL from Step 2 in to URL Tab

Clone Repo From URL Github Desktop Final Step

Click the Clone button—and that’s it! It’s much simpler and cleaner than manually downloading and extracting a ZIP from the GitHub UI.

And sure enough the cloned repo is right beside the one we made in Part 2 of this post! 


📚 Further Reading

  • 🔗 Run Python Scripts in the Cloud
  • 🔗 Install Linux & Docker on Windows
  • 🔗 Make a Python Dashboard

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как ставить таймер на выключение компьютера windows 10
  • Windows recovery environment что это такое
  • Как изменить имя учетной записи администратора в windows 11 на ноутбуке
  • Удобный видеоредактор для windows
  • Окно безопасность windows не открывается