admin管理员组

文章数量:1208155

Problem Summary:

I am working on a Unity project that uses several custom packages, each stored in its own GitHub repository. These repositories include large files tracked with Git LFS. When I clone each repository individually, the LFS files are correctly downloaded. However, when I clone the main Unity project repository, and open the project, Unity imports these custom packages automatically ( the main github reposity hasn't got a reference to the other repos, we let unity itself clone the repository using ssh, using a package.json file shown here), only the non-LFS files are cloned correctly. The LFS-tracked files (such as .png files) appear as placeholders (i.e., they only show file metadata, not the actual content, as shown here, and here), causing errors when the Unity project is opened, shown here.

Steps I've Taken:

  • Run git lfs install to ensure Git LFS is set up.
  • Reinstalled Git and Git LFS.
  • Removed and re-added my SSH key to GitHub.
  • Tried cloning the repository using SSH (git clone ssh://[email protected]/...).
  • Cleared Unity’s cache.

Additional Details:

  • I have both a personal and professional GitHub account, with my SSH key associated with my personal account.
  • When cloning custom repositories individually, everything works fine (all files are cloned correctly).
  • Unity imports the custom packages but fails to load the LFS files correctly.

Error Example:

When the LFS-tracked files (e.g., .png) are cloned, they are added to the project, but only their metadata is shown (e.g., the file’s path) rather than the actual content, leading to errors in Unity.

Logs:

I have checked Unity's logs, but they aren't revealing much more than the placeholder issue for the LFS files, shown here.

What I've Tried:

  • git lfs install
  • Reinstalling Git and Git LFS
  • SSH key reconfiguration
  • Cloning with SSH URL
  • Removing Unity cache

Versions:

  • Unity 2022.3.22f
  • git lfs version 3.6.1 (github; windows amd 64; go 1.23.3; get ea47a34b)

However, no one else in my company is experiencing this issue, so I suspect it may be related to my Git LFS configuration or Unity’s interaction with Git LFS.

本文标签: githubImport Custom packages in Unity using LFSStack Overflow