Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore meta files of unity packages #4173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jmarsh411
Copy link

@jmarsh411 jmarsh411 commented Oct 17, 2022

Unity will automatically generate meta files for just about any file added to its directory structure. This is in order to maintain references between things that may be moving around or getting renamed in the project.

It's very common that an asset from the Unity Asset Store comes with .unitypackage files for optional features or compatibility add-ons. In such a case, the importer's machine will contain a .unitypackage and .unitypackage.meta file.

The .unitypackage file is ignored by this template, but the .unitypackage.meta file is not. If the meta file isn't also ignored, the person who imports an asset containing a .unitypackage file could accidentally commit the meta files. The next person will pull in those meta files, which Unity will consider orphaned without the accompanying .unitypackage file. Unity will automatically delete the orphaned meta files, and those deletes also tend to get committed. The importer auto-adds and commits them again, and the cycle goes on and on until someone like me gets fed up.

This change fixes that inconsistency by adding the *.unitypackage.meta to the ignore list.

Unity packages were already ignored, but it seems in recent versions of Unity these also generate meta files for these. If the meta file isn't also ignored, the person who imports an asset containing a .unitypackage file could accidentally commit the meta files. For another who downloads those meta files, Unity would automatically delete them since they don't have the .unitypackage. The the importer commits them again and the cycle goes on and on until someone like me gets fed up.

This fixes that inconsistency by adding the *.unitypackage.meta to the ignore list.
@Sambo3975
Copy link

Why was this approved but never pulled?

@jmarsh411
Copy link
Author

I would merge it myself, but I don't have the access.

@Dstoney can you pull it?

@danliukuri
Copy link

danliukuri commented Jan 24, 2024

Considering the analogy with .unitypackage, to my mind, it would be logical to extend the ignore list to cover all .meta files for already ignored files under the Assets folder. Also, it would be ideal if it were possible to use some generic approach and not write an additional line for each file extension.

@jmarsh411
Copy link
Author

Considering the analogy with .unitypackage, to my mind, it would be logical to extend the ignore list to cover all .meta files for already ignored files under the Assets folder. Also, it would be ideal if it were possible to use some generic approach and not write an additional line for each file extension.

It looks like someone once upon a time had a generic approach that someone else removed for reasons I'm not really understanding.
7bcea28

I think the discussion of a more generic approach can be opened up in a new PR. But I still believe .unitypackage files cover the most common frustration.

In any case, I'll try to find someone responsive that has write access to merge this.

@jmarsh411
Copy link
Author

@github @shiftkey @bdougie @aroben

Sorry to blast you all. This PR has been approved and sitting for a while. I read the workflow part of the README, but it's not really clear how to proceed in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants