Search Unity

Custom Git Package with git-lfs not working

Discussion in 'Package Manager' started by cg-adam, Aug 27, 2019.

  1. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    I have created a new package which uses git-lfs, but Unity states it cannot run the command:

    "Error when executing git command. git-lfs filter-process: git-lfs: command not found"

    Any ideas how to resolve this?
     
  2. BorisMongeau

    BorisMongeau

    Unity Technologies

    Joined:
    Feb 24, 2017
    Posts:
    58
    Hi,

    Can you give us a bit more details on your operating system?

    Boris
     
  3. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    I'm hitting a similar problem. I have this Git repository that contains the package and in it there are 2 pngs which are LFS tracked. The pngs have thumnails in the the Dashboard, so they seem to be ok in the server. It's just the download that fails("Could not create asset from Packages/com.<package-name>/Runtime/UI/openproject.png: File could not be read").

    Using 2019.2.0f1 on Windows 10 and using a git URL with #<tag>.
    I've used this https://www.patreon.com/posts/25070968 to set up the repository. Everything else is properly exported. Also had a scene in the package and it works as expected. The pngs are missing references in the scene.
     
  4. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    Sure. I am running Unity 2019.2.3f1, on MacOS Mojave 10.14.6. I have SourceTree installed and git installed at a system level through the command line (was installed via brew I believe).
     
  5. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @cg-adam, there was a bug that was fixed in 2019.3.a10. This was not backported in 2019.2. Would it be possible for you to try opening your project using 2019.3 beta to see if the issue is resolved? If it does, we will backport the fix.

    Regards,

    Pascal
     
  6. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    I will try this today.
     
  7. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    I have tried and it does seem to be able to pull the repo down now. However I am having issues with it maybe not pulling the LFS assets properly, they seem to stay as pointers instead of the actual assets. I will have to do some more tests though in a test repo to see if I can resolve it.
     
  8. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    I can confirm that 2019.3.0b1 did not fix my issue as well. The error message stayed the same. What cg-adam suggests seems plausible.
     
  9. Reisender

    Reisender

    Joined:
    Jun 26, 2014
    Posts:
    35
    I have this exact same issue with Unity 2018.4.13f1 in MacOS Catalina 10.15.2 with SourceTree, Git and Git LFS installed at a system level. The package is in a private GitHub repository.

    Opening the project with the exact same configuration but in Windows has no issues at all, but still need to use the Mac also.

    And unfortunately I cannot update to 2019 :(
     
  10. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
  11. Reisender

    Reisender

    Joined:
    Jun 26, 2014
    Posts:
    35
    Hey Pascal, thanks for your reply. I've been a few days trying to understand what I need to do but I just can't get it right. Have you been able to make it work? If so, could you provide some more specific steps to do it?

    Thanks in advance!
     
  12. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hey @Reisender . I'm sorry, I don't have the problem on my system. I was just trying to help you out and see if there were other examples of issues like your out there.
     
  13. terids

    terids

    Joined:
    Sep 23, 2017
    Posts:
    16
    I'm having the same issue as well, with my LFS assets not getting pulled in by the package manager. Is there a bug report for this already?

    Edit: I'm on Windows 10, Unity 2020.1
     
  14. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Not that I'm aware of. Would you mind creating one?
     
  15. terids

    terids

    Joined:
    Sep 23, 2017
    Posts:
    16
    Will do!
     
  16. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    I made one but the team responded they couldn't repro it and needed an example. I haven't got around to making one because my original issue was in an internal work server and I need to try public GitHub or GitLab to make sure I can repro it.
    FWIW, it's Case 1197865.
     
  17. terids

    terids

    Joined:
    Sep 23, 2017
    Posts:
    16
    I also made one and got the same response: Case 1220309.
    I also haven't got around to making an example.
     
  18. PatientZero

    PatientZero

    Joined:
    Apr 8, 2015
    Posts:
    31
    The problem seems to be that the path variable for the launchpad (which is used to launch unity) does not include the path for lfs.
    To change that open up a terminal and type:
    sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

    After a restart everything should work
     
  19. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    This alone didn't work for me, I tried your suggestion first, restarted and the same issue occured. Using an M1 Mac Mini.

    This suggestion worked for me, I added 'sudo' in front of every line they did to get it to work as admin
    https://forum.unity.com/threads/git-lfs-command-not-found.981792/#post-7359485
     
  20. chenzhiyuanthu

    chenzhiyuanthu

    Joined:
    Dec 6, 2021
    Posts:
    1
    I ran into the same problem, and my solution is to uninstall both git and git-lfs installed through homebrew and reinstall them through pkg files downloaded from official websites.
    Make sure that `which git` and `which git-lfs` return `/usr/local/bin/git` and /usr/local/bin/git-lfs`.
     
    ROBYER1 likes this.
  21. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
  22. bleater

    bleater

    Joined:
    Apr 19, 2012
    Posts:
    28
    Just to confirm, the issue for me was that I was using packaging via a git subtree split to create a separate branch, and the .gitattributes file wasn't present in the split-off branch, so Unity didn't know anything about the files needing to be downloaded via git-lfs.

    The solution (for the same problem) is to make sure you have .gitattributes in the root of your published package: https://forum.unity.com/threads/pac...nstead-of-actual-content.993183/#post-8808763
     
    xucian likes this.