6

I'm managing my Unity 2019.3 project in git and I have a directory called Packages in the root of my project. In here there is a file called manifest.json. Is this the only file that matters in the folder or are there other configuration files that could be generated and need tracking?

In other words, is it safe to put the following lines in my .gitignore

/[Pp]ackages/*
!/[Pp]ackages/manifest.json

This is very similar to this question but it doesn't explicitly answer what I want to know.


Edit

To clarify, I am asking if manifest.json will always be enough to regenerate the content of Packages or if there may be other files that are stored in there and required for configuration. I.e. files that won't be the same if left for automatic regeneration by Unity.

The use of this is I have an asset that adds files to that Packages folder and they do not need tracking. They are automatically added back in by the asset when needed. So I want to exclude all but the necessary files from that folder. If the necessary files could change and there is no way for me to know what configuration files could be generated, then I will not do this. If manifest.json is going to always be the only file of importance in that folder, I will leave my .gitignore as it is.

12
  • There is a site called gitignore.io, where you can download a pretty good .gitignore template file: https://www.gitignore.io/api/unity
    – IamK
    Commented Sep 23, 2019 at 9:45
  • This file keeps the list of packages and versions loaded, you should keep it with your project
    – BugFinder
    Commented Sep 23, 2019 at 9:45
  • @C1sc0 Thanks for the link. I was aware of that, thank you. However, it does not provide reasoning for why certain files are / aren't tracked so that is part of the reason why I posted my question.
    – Dan
    Commented Sep 23, 2019 at 9:47
  • @BugFinder Thanks for the comment. I am aware that the manifest file keeps track of which packages are used. If you look at the .gitignore extract you will see I am ignoring everything in Packages except the manifest.json file. My question is whether it is safe to do that or if there are other configuration files that could be generated that need tracking. Very much like manifest.json.
    – Dan
    Commented Sep 23, 2019 at 9:49
  • @Downvoter, why the downvote?
    – Dan
    Commented Sep 23, 2019 at 9:49

1 Answer 1

4

Revisiting this a few months later. I still have found no documentation to confirm manifest.json is the only file that matters in the Packages directory, however, I have not had any issues with adding those two lines to several different Unity projects that use several different packages. It seems pretty safe to add.

Not the answer you're looking for? Browse other questions tagged or ask your own question.