No 'git' executable was found. Please install Git on your system and restart Unity

I get this error when I add git repo to packages. Unity 2019.3.0a11. How can I solve this?

1 Like

I think this post could help you:

https://discussions.unity.com/t/719263

Please take a look at the Requirements section.

Git is in my PATH variable. When I write ‘git’ in PowerShell, it brings up git manual.

1 Like

Could you check where exactly is your git installed? Are you using a custom distribution of git?

I have Git for Windows. I have installed it in “C:\Program Files\Git” directory. “C:\Program Files\Git\bin” has been added to my PATH variables.

Could you try having C:\Program Files\Git\cmd in your path instead of C:\Program Files\Git\bin and see if it works?

I changed the path variable to point to C:\Program Files\Git\cmd but it doesn’t work. Writing git in powershell still works.
When I write ‘git --version’ in powershell, I get this:
git version 2.21.0.windows.1
Is the version ok?

I don’t know if it’s useful to file a bug report since it happens in a literally empty project.
These are the steps that I do:
1- Create a new project (Unity 2019.3.0a11)
2- Open pacakge manager window
3- Click on the plus button and choose ‘Add package from git url’
4- Enter ‘GitHub - omid3098/OpenTerminal: Open Terminal for Unity3D. execute your commands in runtime!’ and press ‘Add’
And this error is printed in the console:
Error

Cannot perform upm operation: Unable to add package [GitHub - omid3098/OpenTerminal: Open Terminal for Unity3D. execute your commands in runtime!]:
No ‘git’ executable was found. Please install Git on your system and restart Unity [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Hi @ ,

We would really like to get to the bottom of this!

Could you try running the following in cmd.exe and not in PowerShell:

where git

1 Like

This is the result of running ‘where git’ in cmd (I opened non-administrator cmd):
“C:\Program Files\Git\cmd\git.exe”

1 Like

Same problem happens to me. Is there any update on how to solve this?

@ There appears to be an issue with the way we look for git in your PATH. To help us debug the issue, would you mind sharing your PATH value by running the following command in cmd:

echo %PATH%

Please feel free to anonymize any personal information like your username. Thank you!

Edit: If you prefer, you can send this in a direct message by clicking my username and then “Start conversation”

2 Likes

Hi @grogshotgames ,

Can you make sure that you’ve quit and restarted Unity as well as Unity Hub since making any changes to your PATH? This is important because Unity Hub will pass the environment it was started with on to the Unity editor. Is it possible you started Unity Hub before making the changes to your PATH?

7 Likes

Restarting Unity Hub solved my issue.
Thanks!

14 Likes

Great! We are going to update the “Please install Git on your system and restart Unity” message to include Unity Hub

8 Likes

Hello,

I’m here for the same problem and I’m still struggling to make it work properly.

In my case, I have a project with a git dependency in the manifest.json file using the git:// scheme:

{
  "dependencies": {
    ...
    "com.e7.notch-solution": "git://github.com/5argon/NotchSolution.git#5ce344a771045c0dae52205e7be49bdda79bbc96"
  }
}

Each time I try to open the project with Unity 2018.3.14f1 (Unity Hub 2.2.1) I get this error message:

5247206--524069--upload_2019-12-4_23-20-23.png

I’ve tried a lot of things, including an installation of Git in a custom folder. It appears in the PATH, I can use the git command from the Windows command line (cmd.exe) and where git give me this:

5247206--524072--upload_2019-12-4_23-20-41.png

I’ve restarted the Hub multiple times and even reboot my computer but I still have this error.

I’ve also tried with Unity 2019.3.0f1, it’s the same issue.

The only thing that make it work is to launch the editor from the Editor folder directly, not from the Unity Hub, but I don’t really know why and how to fix it…

Do you have any idea?

4 Likes

I’ve ran into this problem as well.

Windows 10 Pro 64-bit
Unity Hub 2.2.1
git version 2.24.0.windows.2 (64-bit)
Unity 2019.2.15f1

System-level PATH includes “C:\Program Files\Git\cmd” at the very beginning.
“where git” in cmd.exe returns “C:\Program Files\Git\cmd\git.exe”

Steps:

  • Create an empty project using the “3D” template (the template used probably does not matter though). Unity opens this project without errors.
  • Close Unity.
  • Modify the project’s manifest.json to include "com.unity.2d.tilemap.extras": "https://github.com/Unity-Technologies/2d-extras.git#master",
  • Open the project again. The “No ‘git’ executable was found” error is displayed.

Tested Versions:

  • Unity 2019.2.15f1
  • Unity 2019.2.9f1
  • Unity 2019.1.12f1

Attempted Solutions:

  • Restarted Unity and Unity Hub.
  • Restarted Windows.
  • Installed the latest version of Git for Windows: 2.24.0 (64-bit)
  • Cleared the project’s Library and Temp directories.
  • Moved the directory from in the middle of the PATH variable to the beginning.
  • Reinstalled Unity Hub.

This just started happening, after installing the new version of Unity Hub and Unity 2019.2.15f1. This problem also happens on other projects which were working fine up until now.

HI there,

There is a known issue related to environment variables with the latest version of Hub. The issue will be fixed in the next release (ETA next week or so).

For now, it looks like launching the editor from the Editor folder directly might be the best work-around. (thanks @Noxalus ).

Best,
Ethan

2 Likes

Unfortunately, when I try to open Unity.exe from the Unity\Hub\Editor folder, it just opens Unity Hub. There is a version of the editor in Unity\Editor which works, but it’s version 2018.2 and I need 2019.2. I am currently downloading the Unity 2019.2.15f1 installer from the download archive to see if that version will work without Unity Hub.

Edit: If you uninstall Unity Hub, you can run the Unity editor from Unity\Hub\Editor. Posting this in case it helps anyone else.

Sorry for not saying this earlier; thank you for the response Ethan :slight_smile: It’s good to know that a solution is coming soon.

Had the same problem, but if set “Load Previous Project On Startup”, it does not open the the hub. That workaround of course only makes sense if you have just one main repo you’re working on.
5269869--527574--upload_2019-12-11_9-12-19.jpg

2 Likes

This issue seems to be fixed in the Unity Hub 2.2.2!

Thanks to the Unity team, thank you!