Installing Git for Flutter

Egor Dolgov · 09.11.2026
Which system are you on?
macOS
Windows
Linux
Show me step by step
Subtitles
First, pick your system — the commands will match it.

Git is a version control system. Flutter doesn't work without it: the flutter command uses Git on every run and stops without it with an error:

Error: Unable to find git in your PATH.

Flutter itself is also downloaded with Git — with git clone ( Lesson 0 ). That's why Git goes first.

Contents:

  1. How to open a terminal and paste a command
  2. Windows
  3. macOS
  4. Linux
  5. Checking
  6. Common errors
  7. Summary

1. How to open a terminal and paste a command

The commands on this page are typed into a terminal — a window for text commands. It's easiest not to retype a command but to click Copy next to it and paste it into the terminal.

System How to open Paste a command
Windows Start menu → type PowerShell → open Windows PowerShell Ctrl+V , then Enter
macOS Spotlight (the magnifier in the menu bar) → type Terminal; or Finder → Applications → Utilities → Terminal Command-V , then Return
Linux The Terminal app Right click → Paste, or Shift+Ctrl+V , then Enter

In a Linux terminal the usual Ctrl+V doesn't paste text — use Shift+Ctrl+V .

2. Windows

Open PowerShell, paste the command and press Enter — it's the one git-scm.com gives:

winget install --id Git.Git -e --source winget

If the winget command isn't found, download the Git for Windows installer from git-scm.com/install/windows and run it. One installer page matters for Flutter — Adjusting your PATH environment : keep the default option there, Git from the command line and also from 3rd-party software (Recommended).

3. macOS

Git comes with the Xcode command line tools:

xcode-select --install

A window appears — click Install , accept the license and click Done when it finishes. On a fresh macOS the same window opens by itself if you just type git in the terminal.

4. Linux

On Ubuntu and Debian, use the command from the Flutter documentation: it installs Git along with the other packages Flutter needs. && runs the parts one after another, so it's easy to paste as a whole:

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa

sudo asks for your account password; the characters don't show as you type — type the password and press Enter .

On other distributions Git comes from their package manager: Fedora — sudo dnf install git , Arch — sudo pacman -S git , openSUSE — sudo zypper install git .

5. Checking

Open a new terminal window — windows that are already open don’t see the PATH changes made by the installer — and run:

git --version

The command prints the version, for example on a Mac:

git version 2.54.0 (Apple Git-157)

If the terminal says the command is not found, Git isn't installed or isn't in PATH. Make sure you opened a new terminal window; if you used the installer, check that the default option was kept on its PATH page (section 2).

6. Common errors

“Error: Unable to find git in your PATH”. The flutter command says this when it can't find Git: install Git (sections 2–4), close and reopen your terminal and editor, check git --version and try again.

“detected dubious ownership in repository”. Git won't open a repository whose folder belongs to another user, and suggests a command to allow it. With Flutter folders this happens on Windows — for example, with FVM. The FVM documentation suggests allowing all folders at once:

git config --global --add safe.directory "*"

Then restart your terminal and editor. The * value turns this Git check off completely — use it only if you trust the folders on your computer.

“Error: The Flutter directory is not a clone of the GitHub project”. The Flutter folder must be a Git repository clone. Download Flutter again as in Lesson 0 , section 2.

7. Summary

  • Flutter doesn't work without Git — install it first.
  • Windows — winget install --id Git.Git -e --source winget ; macOS — xcode-select --install ; Linux — the package manager.
  • Check with git --version .

Next — installing Flutter itself: Lesson 0 .