Search Unity

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

Discussion in 'Package Manager' started by Deleted User, Aug 19, 2019.

  1. Deleted User

    Deleted User

    Guest

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

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    I think this post could help you:

    https://forum.unity.com/threads/git-support-on-package-manager.573673/

    Please take a look at the `Requirements` section.


     
  3. Deleted User

    Deleted User

    Guest

    Git is in my PATH variable. When I write 'git' in PowerShell, it brings up git manual.
     
    Everbyte likes this.
  4. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    Could you check where exactly is your git installed? Are you using a custom distribution of git?
     
  5. Deleted User

    Deleted User

    Guest

    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.
     
  6. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    Could you try having `C:\Program Files\Git\cmd` in your path instead of `C:\Program Files\Git\bin` and see if it works?
     
  7. Deleted User

    Deleted User

    Guest

    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:
    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()
     
  8. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @mnarimani,

    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
     
  9. Deleted User

    Deleted User

    Guest

    This is the result of running 'where git' in cmd (I opened non-administrator cmd):
    "C:\Program Files\Git\cmd\git.exe"
     
    ChristopherKerr likes this.
  10. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Same problem happens to me. Is there any update on how to solve this?
     
  11. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    @mnarimani 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"
     
    yomotu and miniturehero like this.
  12. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    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?
     
  13. Deleted User

    Deleted User

    Guest

    Restarting Unity Hub solved my issue.
    Thanks!
     
    Frolky, OmerFI, Vsadow and 11 others like this.
  14. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Great! We are going to update the "Please install Git on your system and restart Unity" message to include Unity Hub
     
  15. Noxalus

    Noxalus

    Joined:
    Jan 9, 2018
    Posts:
    80
    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:

    Code (JavaScript):
    1. {
    2.   "dependencies": {
    3.     ...
    4.     "com.e7.notch-solution": "git://github.com/5argon/NotchSolution.git#5ce344a771045c0dae52205e7be49bdda79bbc96"
    5.   }
    6. }
    Each time I try to open the project with Unity 2018.3.14f1 (Unity Hub 2.2.1) I get this error message:

    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:

    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?
     
    Last edited: Dec 4, 2019
  16. MikeITS

    MikeITS

    Joined:
    Apr 3, 2015
    Posts:
    5
    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:
    1. Create an empty project using the "3D" template (the template used probably does not matter though). Unity opens this project without errors.
    2. Close Unity.
    3. Modify the project's manifest.json to include
      "com.unity.2d.tilemap.extras": "https://github.com/Unity-Technologies/2d-extras.git#master",
    4. Open the project again. The "No 'git' executable was found" error is displayed.
    Tested Versions:
    1. Unity 2019.2.15f1
    2. Unity 2019.2.9f1
    3. Unity 2019.1.12f1
    Attempted Solutions:
    1. Restarted Unity and Unity Hub.
    2. Restarted Windows.
    3. Installed the latest version of Git for Windows: 2.24.0 (64-bit)
    4. Cleared the project's Library and Temp directories.
    5. Moved the directory from in the middle of the PATH variable to the beginning.
    6. 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.
     
    Last edited: Dec 10, 2019
  17. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    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
     
    Mashimaro7 and MikeITS like this.
  18. MikeITS

    MikeITS

    Joined:
    Apr 3, 2015
    Posts:
    5
    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.
     
    Last edited: Dec 10, 2019
  19. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    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.
    upload_2019-12-11_9-12-19.png
     
    pachermann and MikeITS like this.
  20. Noxalus

    Noxalus

    Joined:
    Jan 9, 2018
    Posts:
    80
    This issue seems to be fixed in the Unity Hub 2.2.2!

    Thanks to the Unity team, thank you!
     
  21. tmesser

    tmesser

    Joined:
    Jan 3, 2020
    Posts:
    1
    I am on Unity Hub 2.2.2 and I am definitely still having this issue.

    upload_2020-1-2_20-51-23.png

    My PATH includes both
    C:\Program Files\Git
    and
    C:\Program Files\Git\cmd
    and I have restarted both Unity Hub and Unity Engine a few times since adding them. Is there anything I may have missed?
     
  22. sandeepkiks

    sandeepkiks

    Joined:
    Nov 20, 2018
    Posts:
    1
    If any one facing the issue even after installing Git, adding in env path, try restarting the PC.
    It worked for me.
     
  23. SB12unitypro1

    SB12unitypro1

    Joined:
    Sep 27, 2018
    Posts:
    3
    Hi I'm still having this error, with version 2019.3.0f6 and its not related to Hub because I deinstalled it and run unity as admin
    upload_2020-5-29_11-38-4.png

    Also its possible to find git in the console, and my PATH is
    C:\Program Files\Git\cmd
    and
    C:\Program Files\Git LFS

    And my version is
    git version 2.26.2.windows.1
     
  24. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    This looks like a misconfigured Git installation.

    Searching for "git remote-https is not a git command" on Google reveals a lot of troubleshooting resources that could help you. We cannot help you further than that, I'm afraid.
     
  25. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    For those who've followed the directions above but are still having trouble. If you are using Windows, please check the PATH variable in system environment and make sure that the path points to the git executable.

    I thought my PATH variable was set because I was checking it in my unix terminal (i don't like using cmd). Check the PATH using cmd and see if it's set there!
     
  26. myfrendisjack

    myfrendisjack

    Joined:
    Sep 27, 2020
    Posts:
    2
    I am really dumb, and don't know how to set a "path" any chance you fellows could give me some help.
     
    Llareia likes this.
  27. davidim22

    davidim22

    Joined:
    Nov 11, 2020
    Posts:
    1
    This video helped me a lot. Hope this will solve your problem.

     
  28. EMOTION-THEORY

    EMOTION-THEORY

    Joined:
    Jul 16, 2013
    Posts:
    83
    FIXED! I had the same issue and this video helped me too! Thank you!

    For anyone else with the issue, just remember: once you follow the steps of the video, right-click the Unity Hub taskbar icon and choose 'Quit Unity Hub' from there, then try again (simply closing and re-opening the app won't work).
     
  29. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    I had to restart my pc after installing Git for it to work and ask me for my git credentials.
     
    Ryuuguu and AjSpeed like this.
  30. badrujamand

    badrujamand

    Joined:
    Mar 23, 2021
    Posts:
    1
    Thanks
     
  31. YangLiuSH

    YangLiuSH

    Joined:
    Jul 3, 2019
    Posts:
    3
    Thanks! Closing the UnityHub by clicking the close button doesn't actually close it! What a tricky cause!
     
    Ryuuguu likes this.
  32. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Would it be possible in future releases to optionally install git and any other dependency, like for example the visual studio is installed or the Android libraries.

    Thanks
     
    Loden_Heathen likes this.
  33. shirleycreates

    shirleycreates

    Joined:
    May 18, 2021
    Posts:
    2
    **Update** This issue is resolved
    So I had some extra spaces that needed to be deleted after I pasted the URL in Package Manager o_O I'll just leave this here in case anyone else runs into the same issue. Lol

    Hey all, I've tried the steps from above and now I'm getting a different error:

    Cannot perform upm operation: Unable to add package [https://github.com/De-Panther/unity-webxr-export.git?path=/Packages/webxr ]:
    Cannot checkout repository [https://github.com/De-Panther/unity-webxr-export.git] on target path [Packages/webxr ]:
    Error when executing git command. error: pathspec 'Packages/webxr ' did not match any file(s) known to git
    [NotFound]
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()


    I'm using Windows 10 Home 64-bit
    Unity 2020.3.7f1
    Git 2.31.1
    Unity 2019.4.26f1

    Any suggestions for this?
    upload_2021-5-18_13-31-0.png
     

    Attached Files:

    Last edited: May 18, 2021
  34. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,932
    Still broken in 2020.3.x

    I haven't tried rebooting yet (rebooting? Seriously? Just to get the Hub to stop being broken?). I'm guessing the bug here is that "quitting" the Hub doesn't actually quit it. But it's embarassing that the Hub is so awful: Windows doesn't even need you to close and re-open the windows, path updates are instantaneous everywhere else ... except Unity.
     
    ricardoamores likes this.
  35. spilat12

    spilat12

    Joined:
    Feb 10, 2015
    Posts:
    38
    Strongly disagree with that. As long as I've been using Windows, it's always the same: sooner or later you'll have to go and edit environment variables manually. Because it's Windows being Windows.

    But yes, as for fixing this problem, I can confirm that adding variable to the path solved it for us as well. See the video above!
     
  36. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,932
    Uh, yes ... but updating those variables immediately updates them for all apps - including all Microsoft ones.

    Unity ... requires a multiple-minutes-long restart.
     
  37. shacharoz

    shacharoz

    Joined:
    Jul 11, 2013
    Posts:
    98
    hi,
    after installing git and restarting unity hub and other instanaces,
    when pressing where git or git, i get the expected results.
    but i still get the error trying to add a git package
     
  38. BobM55

    BobM55

    Joined:
    Dec 13, 2021
    Posts:
    1
    This discussion was very helpful. After installing git I hadn't realized that the previous unity git failures left both hub and editor zombie processes. Opening the task manager, killing the hub processes and then the editor zombies then reopening hubs/editor fixed this issue for me. (yes, cmd could execute git)
     
    a436t4ataf likes this.
  39. NobleRobot

    NobleRobot

    Joined:
    Jan 14, 2016
    Posts:
    56
    I think some of the problems people have had with this is a result of poor messaging about what Unity Hub is.

    Unity Hub is a license manager utility like Adobe Creative Cloud or Google Drive, which stays open all the time regardless of whether the application window is open, but users (especially users who don't have a pro license, which is to say the vast majority of users) don't at all view it like that. Users view it like a simple launcher application, whose job is finished when the Editor finishes loading. So, when a user is told to "restart Unity Hub," what they hear is "close and re-open the Unity Hub application window," even though that doesn't do anything since the Unity Hub process stays running the entire time.

    It might be better to say something like "close Unity Hub using the icon in the notification area" or something. That's a little verbose, and users should be able to figure that out for themselves, but the root of the issue seems to be that Unity Hub is generally poorly explained to them.
     
    maximeb_unity likes this.
  40. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,932
    That's just not true.

    Unity had a licensing manager. And they had the UnityEditor.

    Then someone at Unity decided to create the Hub. If the Hub were merely a license manager utility then everything would still work how it used to. Instead the Hub has been (ab)used by Unity staff to try and force a bunch of unrelated features in (e.g. core functionality was *deleted* from the Editor and recreated - badly, brokenly - in the Hub. Cynically: because so many people hated the Hub (a poor quality, poorly designed, unnecessary, piece of bloatware) that uptake was slow - so they made it impossible to not use it).
     
  41. PieRed

    PieRed

    Joined:
    Jun 29, 2020
    Posts:
    1
    This was literally the one very small step I was missing. I assumed that simply closing the app regularly would reset it. I didnt know it was a "still running in the background" application. Thanks SO much
     
  42. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    I've had the issue, the doc said that I needed to install git lfs that the message does not mention, I did and it did not work. Then I clicked on the message it said below that I needed to restart Unity and Unity Hub, which I did and it did not work. Finally I rebooted the computer and it worked.

    Now I realize that the solution was in this thread but I did not notice it at first glance...
     
  43. JuanNeyraAlonzo

    JuanNeyraAlonzo

    Joined:
    Jan 10, 2019
    Posts:
    2
    Hi man thanks a lot you save my day :D
     
  44. xaxa1167YTinfinfCEO

    xaxa1167YTinfinfCEO

    Joined:
    Nov 23, 2022
    Posts:
    1
    I am reading this page for about 3 hours now and i am used the current beta version of the hub and i downgraded it and its working now :D
     
  45. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    Yep it also worked for me, this is the fix, thank you
     
  46. JonathanBartel

    JonathanBartel

    Joined:
    Jun 24, 2019
    Posts:
    47
    Wanted to chime in to +1 @danUnity's comment. On our small team, restarting Unity and Unity Hub after following the instructions above was sufficient, but one person did have to do a full reboot of his machine for the changes to take effect.
     
  47. lambch0p

    lambch0p

    Joined:
    Oct 22, 2014
    Posts:
    62
    Look in Task Manager under Background Processes. Even after closing Unity Hub from the taskbar I still had about 10 Unity Hub processes active. Right-click on each and select 'end task'. One of them will be the uber-process and the rest will probably die along with it. It works fine after doing this - basically what a restart does.
     
    retox, Fenikkel and ijdonnelly11 like this.
  48. Fenikkel

    Fenikkel

    Joined:
    Sep 24, 2019
    Posts:
    20
    Got the error in Unity 2021.3.16: No 'git' executable was found. Please install Git on your system then restart Unity and Unity Hub [NotFound]


    On Windows solved the problem doing this:
    • Installing Git (During the instalation, tick on "Add a Git Bash Profile to Windows Terminal)
    • Closed all the Unity instances and Github (it's important to close it also in the Windows taskbar)

      upload_2023-5-10_13-47-12.png
      Windows taskbar
     
  49. doodler345

    doodler345

    Joined:
    Dec 30, 2021
    Posts:
    28
    For me also restarting the PC after GIT Install was necessarry to solve.
     
  50. Magnus_FK

    Magnus_FK

    Joined:
    Apr 7, 2023
    Posts:
    1
    Thanks, this helped