Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

how do you use the package manager with git?

Discussion in '2020.2 Beta' started by laurentlavigne, Aug 1, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,007
    entering a url is abnormally slow so trying out tarball
    I download a tar.gz https://github.com/Unity-Technologies/Graphics/archive/v10.0.0-preview.26.tar.gz
    then
    upload_2020-7-31_17-52-53.png
    point to the tar.gz that was just downloaded
    and i'm getting this
    upload_2020-7-31_17-53-47.png
    which is odd because 2020.2 does recursive
    so i check the PM version but it won't show up in the PM search
    upload_2020-7-31_17-54-56.png
    maybe it's due to the errors gracing the console but i don't think so, PM should be working regardless (as in MUST, since it's essential to unity now that most things are packages)
    upload_2020-7-31_17-55-46.png
     

    Attached Files:

  2. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    513
    Did you try putting the package into the Packages folder of your project?

    - Assets
    - Builds
    - Library
    - Packages <--- Move tgz here
    - ProjectSettings

    When the package is there I believe it auto-adds, but if not add it again through the menu.

    If that doesn't work, you may want to have your git client that supports LFS to create a clone of the given branch to the Packages folder directly.
     
    VaheNextEpic likes this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,007
    I just tried that but it doesn't show up
    upload_2020-7-31_19-27-14.png
    that would have been nice but I understand why it isn't included: it would take a long time to startup the editor.
    tried your second suggestion and get nothing
    except that searching "core" now returns nothing which has been my experience with package manager breaking easily when there are compile errors
    (console after I + core, urp, vfx and shader graph separately)
    upload_2020-7-31_19-44-23.png
     
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Why two threads? https://forum.unity.com/threads/a19-and-urp10.942783

    You can NOT use tarball or zip from github with Graphics repository. Graphics repo requires git LFS and just pulling archive will not give you any binary files. This will result in numerous errors.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,007
    yes, I bypassed the dreadful git desktop, went command line following instructions on the github page and got it working
    besides going command line i think the trick was to import urp twice.
    thanks for the help
     
  6. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    On a Mac I highly recommend Homebrew to install Git. But I think you’re on Windows?
     
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,007
    Yes I am.
    It's ok, the command lines are on the github page, I just copy pastaed it, it's just that in some cases I use github desktop and it's worked.
     
  8. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    So using a url is slower than downloading/cloning the entire repo locally? what?
     
  9. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I feel there's always some overhead in using PM for this but for example I haven't managed to get PM do anything fast with multiple big git packages. In theory PM should be able to reuse the same repo when you have multiple paths with same repo but in my brief testing the import times were still awfully slow in comparison to just cloning the repo manually and then assigning the unity projects manifest the file refs that just point to the cloned repo paths (or simply copy over the packages into your packages folder).

    Worth noting here is that you simply can NOT download entire repo locally from github using the github's download option since Graphics repo uses git LFS and zip download would just not get any binary files. If this worked, it would be really snappy but now we have to clone the whole repo, which I believe is around 4GB of data. This will take a long time with git.
     
    Last edited: Aug 11, 2020
  10. sendspace

    sendspace

    Joined:
    Jul 24, 2016
    Posts:
    40
  11. sendspace

    sendspace

    Joined:
    Jul 24, 2016
    Posts:
    40
    can you tell me whats the size of that tarball after download ?
     
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,007
  13. seyyiddogan

    seyyiddogan

    Joined:
    Jul 29, 2021
    Posts:
    2
    For all the people who just want to include a tar.gz package to their project, Make a folder in Packages directory, copy the contents of packages folder inside the tar.gz package, and paste into that directory. When you are done the folder inside the packages folder in project root should have package.json file.
     

    Attached Files:

    • ss.png
      ss.png
      File size:
      111.6 KB
      Views:
      344
    IL_Briz likes this.