79684678

Date: 2025-06-30 11:23:58
Score: 2
Natty:
Report link

This error typically indicates that a corrupted or misconfigured Git installation or environment variable is interfering with Flutter’s access to Git.

Let’s go step-by-step to fix this:


1. Check if Git is working

Run this in Command Prompt (not PowerShell):

git --version

If this triggers the "select an app to open 'git'" prompt, your system doesn't recognise Git correctly.


2. Ensure Git is added to PATH

  1. Press Win + S, search for Environment Variables.

  2. Open Environment Variables > System Variables.

  3. Find the Path variable, click Edit.

  4. Ensure Git's bin and cmd paths are present, e.g.:

    C:\Program Files\Git\cmd
    C:\Program Files\Git\bin
    
    
  5. Click OK to save.

If you installed Git via GitHub Desktop or another non-standard path, make sure those entries are removed and only valid paths exist.


3. Clear corrupted Git environment variables

Check if there's a GIT_* environment variable that might be interfering:

  1. In the same Environment Variables window, look under User Variables and System Variables for:

    • GIT_EXEC_PATH

    • GIT_TEMPLATE_DIR

    • Any other GIT_* variables

If found and you’re not explicitly using them, delete them.


4. Reboot

Restart your machine to apply all changes, then try:

flutter doctor

5. Still not working? Try setting Git manually for Flutter

Open your .bashrc (if using Git Bash) or set Git path manually in flutter.bat (not usually needed, but in extreme cases):

set GIT_EXECUTABLE=C:\Program Files\Git\bin\git.exe
flutter doctor

Reasons:
  • Blacklisted phrase (2): Still not working
  • RegEx Blacklisted phrase (2): working?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • High reputation (-1):
Posted by: Abhishek