Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Running flutter prints 'Error: Unable to find git in your PATH'

ErrorError: Unable to find git in your PATH.

Short answer

The flutter launcher script runs git before anything else. If the shell cannot find a git program, or the SDK folder has no .git entry, it stops with this error. Install git, open a new terminal so it sees the updated PATH, and use a Flutter SDK that was installed as documented.

  • Applies to Flutter 3.3x stable, macOS 26 with Xcode command-line tools, Ubuntu 24.04, Git for Windows (Git Bash)
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the same shell where git is. If this prints a path, git is fine and you should look at the SDK folder; if it prints nothing, git is not on the PATH of this terminal.

    command -v git
    echo "$PATH"
  2. 2Match what you see, then jump to its fix

    1. 1command -v git prints nothing and a fresh shell has the same resultgit is not installedFix
    2. 2git works in one terminal window and fails in another, or only inside an editor's terminalgit is installed, but this terminal or IDE started before it was added to PATHFix
    3. 3Error: The Flutter directory is not a clone of the GitHub project.The SDK folder is a downloaded archive, not a git cloneFix

What does the error look like?

  • Error: Unable to find git in your PATH.
  • Error: The Flutter directory is not a clone of the GitHub project.
  • The flutter tool requires Git in order to operate properly;

Cause 1 of 3

git is not installed

1Check

Flutter's install guide lists git as a requirement: on Linux it sits in the package list with curl and unzip, and on macOS it comes with the Xcode command-line tools.

git --version

2Fix

On Ubuntu install the packages from Flutter's list. On macOS install the command-line tools; Apple notes that on a fresh system running a tool such as git also offers to install them.

# Ubuntu / Debian
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa

# macOS
xcode-select --install

3Verify

git answers, and flutter starts.

git --version
flutter --version

Confirmed by docs.flutter.dev

Did this fix it?

Cause 2 of 3

git is installed, but this terminal or IDE started before it was added to PATH

1Check

Flutter's guide tells you to close and reopen terminals and IDEs after a PATH change. Compare the result in the failing window with a window that works.

command -v git
which -a git

2Fix

Quit the editor completely and start it again so it reads the new environment. For a Git Bash session on Windows, choose the installer option that puts git on the command line, as the Git for Windows setup describes, then open a new window.

# Git for Windows installer, PATH step:
# "Git from the command line and also from 3rd-party software"

3Verify

In the failing window, git is found and flutter runs.

command -v git
flutter doctor

Confirmed by docs.flutter.dev

Did this fix it?

Cause 3 of 3

The SDK folder is a downloaded archive, not a git clone

1Check

The launcher script tests for a .git entry in the SDK root and exits when it is missing; git is then needed to read the SDK revision. Look inside the folder that holds bin/flutter.

ls -a "$(dirname "$(dirname "$(command -v flutter)")")" | head -n 20

2Fix

Remove the copied or re-packed folder, extract the official SDK archive again as the install guide shows, and point PATH at its bin folder. Do not copy the SDK around without its hidden .git entry.

# macOS, example file name from the install guide
unzip ~/Downloads/flutter_macos_3.50.0-stable.zip -d ~/develop/
export PATH="$HOME/develop/flutter/bin:$PATH"

3Verify

flutter runs and prints its version.

flutter --version

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Install git before the Flutter SDK, on every new machine and CI image.
  • Install the SDK from the official archive and never copy the folder without its hidden .git entry.
  • After any PATH change, restart your editor as well as the terminal.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

A phone is plugged in over USB but Android Studio and adb do not list it

adb devices prints List of devices attached with nothing below it

adb lists a phone only when four things hold: USB debugging is on, you accepted the computer's RSA key on the phone, the computer has a driver or udev rule for the device, and the cable carries data to a running adb server.

6 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.