Search Unity

Git support on Package Manager

Discussion in 'Package Manager' started by rizu, Oct 24, 2018.

  1. Ooctopus

    Ooctopus

    Joined:
    May 28, 2019
    Posts:
    3
    Thank you but that's not my question.

    I would to know what I need to do to import the external package of this project, because at this time if I just clone/download the project and import it in Unity there are some missing files...
     
  2. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    Tell us exactly what you're doing and what the errors/missing files are.

    As far as I know - assuming git is already installed on your system - it should be as simple as opening the downloaded project via the Unity Hub.
     
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,272
    Is there any way to get the package manager to check for new versions of the git project. Allow you to update like with the Unity packages?

    Lennart
     
  4. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    475
    Manually, you can. Just delete the lock that appears at the end of the packages file. They should include a section on the package manager that indicates if there's any update on that package and let the user update it.
     
  5. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    398
    Hey @okcompute_unity @maximeb_unity,

    Thank you guys for your work and the communication here!

    A question, if I may. Afaik, it was planned to add UI for Git dependencies in 2019.1, but in the manual it's now mentioned that installing a Git repo via Packages window is impossible. Does that mean you've decided to not add the UI for remote dependencies, or is it still in the works (what's the new ETA, in case it's the latter)?
     
  6. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    241
    @Elringus I think we don't rely on unity version to expect a feature anymore. The git support API will be added (or not) from the Package Manager package itself, not related to unity version. So they might still doing it, but the unity 2019 just already launched because it was not related and depend on each other anymore
     
  7. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    340
    I seem to run into a problem with git LFS on MacOSX...
    On Windows everything goes fine but on Mac it can't seem to find git lfs even though when I run a terminal 'git lfs version' returns its version 2.7.2
    I've installed git lfs via brew and initialized it, but still it won't budge. Anything I might've forgotten to config?

    MacOSX LFS error.png
     
  8. Tsequier

    Tsequier

    Joined:
    Apr 20, 2016
    Posts:
    11
    Hello, I've managed to make everything work as I wanted, but one thing remain on the git setup side of the thing.
    When I look at, for example, Keijiro's repo (like this recent one https://github.com/keijiro/Rsvfx), he has (minimum) 2 branches, one with the full unity project, like master, and another one called upm which one has the necessary file for the package at the root. Does one of you know how to set up something like that with git ? Is it several .gitignore, or something like subtree or submodule (I'm not very knowledgeable about git)? Thanks !
     
  9. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    I investigated complex ways to achieve this with git subtree and sparse checkouts and came to the conclusion it's better just to maintain the two branches manually. Git terrifies me once you get off the beaten track - it's ability to become a task in itself separately from the problem you're actually trying to solve is unparalleled outside of maybe the morbid allure of regular expressions.
     
  10. Tsequier

    Tsequier

    Joined:
    Apr 20, 2016
    Posts:
    11
    @andybak Thank you, I absolutely agree with your statement regarding git, so I am going to do it manually as well !
     
  11. misher

    misher

    Joined:
    Apr 22, 2016
    Posts:
    17
    Hi.
    I've tried to add a git package, this one: https://github.com/kolodi/com.kolodi.unity-goodies
    But I have errors.

    When typing simply "https://github.com/kolodi/com.kolodi.unity-goodies" it says:
    Cannot perform upm operation: Unable to add package ["https://github.com/kolodi/com.kolodi.unity-goodies"]: 
    Package name '"https://github.com/kolodi/com.kolodi.unity-goodies"' is invalid. [InvalidParameter]


    So I've tried "https://github.com/kolodi/com.kolodi.unity-goodies.git". It worked for some instants on and the I have the following error message:
    Cannot perform upm operation: Unable to add package [https://github.com/kolodi/com.kolodi.unity-goodies.git]:
    Error when executing git command. fatal: 'submodule' appears to be a git command, but we were not
    able to execute it. Maybe git-submodule is broken? [NotFound]


    Then I cloned the repo to my local machine and was able to add package from disk without any issue.

    I'm using latest (at this moment) Unity: 2019.3.0a8
     
  12. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    358
    It likely is somewhere already answered but I was not able to quickly find this information:
    • How to I provide all published versions via the package manager and not only the one specified via the git url/specific tag?
    • Is it already possible to set up custom urls for the 3 links hardcoded (the last thing I have read somewhere was "plannet but not in yet - on the timeline for 2020")
     
  13. Karashi-shiki

    Karashi-shiki

    Joined:
    Jul 9, 2019
    Posts:
    1
    Last edited: Jul 12, 2019
  14. misher

    misher

    Joined:
    Apr 22, 2016
    Posts:
    17
    Issue resolved! You should add git bin folder path to the PATH variable on Windows. In my case it was: "C:\Program Files\Git\bin". Without it, "git submodule" command doesn't work.
     
  15. manu73

    manu73

    Unity Technologies

    Joined:
    Aug 22, 2014
    Posts:
    29
    Hi @misher!

    GIT support (including SSH urls) for packages is now available in Unity 2019.3.0a10.

    Regards,

    Manu.
     
  16. Vapid-Linus

    Vapid-Linus

    Joined:
    Aug 6, 2013
    Posts:
    58
    This Patreon post explains how to do it:
    https://www.patreon.com/posts/25070968