Search Unity

git-lfs command not found

Discussion in 'Linux' started by oxysofts, Oct 3, 2020.

  1. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    124
    There are some git packages that we want to use through the package manager, however when I try to open the project I get this error

    upload_2020-10-3_11-30-10.png

    Both git and git-lfs work from the terminal and are installed with apt through the packages available out of the box in on Linux Mint. They are both in /usr/bin.

    This is the error itself

    Code (CSharp):
    1.  COMMAND LINE ARGUMENTS:
    2. /home/nuck/Unity/Hub/Editor/2020.1.6f1/Editor/Unity
    3. -projectpath
    4. /home/nuck/Repositories/Nanokin
    5. -useHub
    6. -hubIPC
    7. -cloudEnvironment
    8. production
    9. -hubSessionId
    10. 996b0170-0588-11eb-8965-17548b3d3c0b
    11. -accessToken
    12. Tgtw8TE_vx1uoLqFtdYWgYJsAgDaJoYnAWalZOv3EkU003f
    13. Successfully changed project path to: /home/nuck/Repositories/Nanokin
    14. /home/nuck/Repositories/Nanokin
    15. Using Asset Import Pipeline V2.
    16. Error when executing git command:
    17.   - args: checkout, 561339c07f940a0238c43d6cc77c1836373f7fa9
    18.   - stdout:
    19.   - stderr: git-lfs filter-process: git-lfs: command not found
    20. fatal: the remote end hung up unexpectedly
    21.  
    22. [Package Manager] Done resolving packages in 4.53s seconds
    23. An error occurred while resolving packages:
    24.   Project has invalid dependencies:
    25.     com.realgames.dear-imgui: Cannot checkout repository [https://github.com/realgamessoftware/dear-imgui-unity.git]:
    26.       Error when executing git command. git-lfs filter-process: git-lfs: command not found
    27.       fatal: the remote end hung up unexpectedly
    28.  
    29.  
    30. A re-import of the project may be required to fix the issue or a manual modification of /home/nuck/Repositories/Nanokin/Packages/manifest.json file.
    31. [Unity Package Manager (Upm)]
    32. Parent process [480] was terminated

    Any ideas? Would like to try Linux for gamedev since it is lighter. Thanks

    edit: I believe it is fixed now after making symlinks in /usr/local/bin

    Code (csharp):
    1.  
    2. $ which git                                            
    3. /usr/local/bin/git
    4. $ which git-lfs                                        
    5. /usr/local/bin/git-lfs
    6.  
     
    Last edited: Oct 5, 2020
  2. awhiskin

    awhiskin

    Joined:
    Jan 16, 2019
    Posts:
    1
    Just bumping this response, I had the same issue.

    I am using an M1 MacBook Air and installed both git and git-lfs using home-brew. The trouble is, home-brew installs packages to /opt/homebrew/bin/git rather than /usr/local/bin/

    I had to create symlinks to all git files in /usr/local/bin/ by running the following commands:

    ln -s /opt/homebrew/bin/git /usr/local/bin/
    ln -s /opt/homebrew/bin/git-cvsserver /usr/local/bin/
    ln -s /opt/homebrew/bin/git-lfs /usr/local/bin/
    ln -s /opt/homebrew/bin/git-receive-pack /usr/local/bin/
    ln -s /opt/homebrew/bin/git-shell /usr/local/bin/
    ln -s /opt/homebrew/bin/git-upload-archive /usr/local/bin/
    ln -s /opt/homebrew/bin/git-upload-pack /usr/local/bin/

    After this, Unity was able to use git-lfs and the package resolved successfully.
     
  3. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Thanks, this worked for me! I had to sudo every line on my Mac Mini M1 to get it to work
     
  4. IceCone_Topy

    IceCone_Topy

    Joined:
    Mar 2, 2021
    Posts:
    1
    Work for me too!! i have issue this problem in gitlab runner all day, and finally fix by your solution