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.

[quote=“okcompute_unity”, post:3, topic: 719263]
Glad you have found the pattern :). As stated in the release notes, this is an experimental feature. We are targeting production ready quality for 2019.1. Super glad that you are trying this out though. Please, let us know if you find any issues.

And here is a minimalist documentation if you would like to expand your testing further and maybe for others who are reading this thread.

Requirements

To use Git packages in a project, Git must be installed on the user machine. The Git executable path should be listed in the PATH system environment variable.

Project manifest lock attribute

This feature introduces a new lock attribute in the project manifest. This attribute is populated by the Package Manager to render the package configuration resolution deterministic.

Supported URL schemes/protocols

The Package Manager supports the same URL schemes as Git does. In fact, the URL is passed to the Git executable (minus the revision part). If Git ever adds support for more protocol/schemes, they will automatically be supported by the Package Manager.

List of supported schemes

  • git:
  • ssh:
  • https:
  • http:
  • _file: (_only URL-like path are supported for now. i.e. file://absolute/path/repo.git. System path will be supported later. This could allow using relative path for example file:…/…/repo.git)

We also support SCP style pattern:

git@github.com:user/repo.git

Revisions

You can select a specific revision to be cloned by the Package Manager. The revision is prefixed by the # character. The revision should be added after .git extension:

https://repository/path.git#revision

The revision can be any commit-ish - an expression that eventually resolves to a commit hash. The most common types of commit-ish are commit hashes, tags, and branches.

Limitations and good to know:

  • The Package Manager UI was not updated to support this new package source (ETA 2019.1). I haven’t seen any more issue though.

  • Big repositories can take a long time to clone. We don’t cache the repository so if you change revision, the repository will be cloned again.

  • The only way to update a Git package to the latest version is to remove the lock attribute from the project manifest or manually update the revision suffix.

  • Since the Package Manager uses the Git executable installed on your machine. Any global or system configuration or environment variable will be picked up. These settings may affect the behaviour of the system.

  • Some package managers offer a shorthand version of their supported URL schemes. For example, npm support short URLs like these: /, gitlab:/. We don’t support these syntaxes for the moment.

Hope this will help you test the feature.

Regards,

Pascal
[/quote]

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 'https://github.com/omid3098/OpenTerminal.git' and press 'Add'
And this error is printed in the console:
Error

[spoiler]
Cannot perform upm operation: Unable to add package [https://github.com/omid3098/OpenTerminal.git]:
No 'git' executable was found. Please install Git on your system and restart Unity [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

[/spoiler]

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?

6 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 :) 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!