0
Answered

Github Upload problem

Basile 1 year ago in Game Creator updated by Marti (Lead Developer) 1 year ago 7

We were facing a strange problem.

After installing Game Creator on the project on one computer and pushing the project on github when trying to clone the project on another computer we found out that all the Library folder (that contains the Parser, Tokenizer classes and associated meta files) and the two .unitypackage files were missing.

We found out that the culprit was the default .gitignore file.

We solved it by including another .gitignore file inside Assets folder telling it to include Library folders and .unitypackage files.


Is this the way to go or is there another more correct way of doing it?

Unity version:
2019.2.0
Game Creator version:
0.9.9

Answer

Answer
Answered

Hi! This is a common problem. Did you write your own .gitignore file or pulled it from somewhere?

Depending on your project structure, you'll need a different path, but here's how: You probably have an entry that ignores all Library/ folders. Game Creator uses that name to store the Tokenizer and Parser class files, so they get ignored.

To solve this, simply modify the Library/ path and change it to /Library/ (notice the first slash before the name). This will tell Git to ignore all files under Library/ at the root of the project.

If this doesn't work means that you have a different folder structure. Feel free to send us a screenshot of your project's hierarchy and we'll tell you exactly what to modify in the gitignore.

GOOD, I'M SATISFIED
Satisfaction mark by Basile 1 year ago
Answer
Answered

Hi! This is a common problem. Did you write your own .gitignore file or pulled it from somewhere?

Depending on your project structure, you'll need a different path, but here's how: You probably have an entry that ignores all Library/ folders. Game Creator uses that name to store the Tokenizer and Parser class files, so they get ignored.

To solve this, simply modify the Library/ path and change it to /Library/ (notice the first slash before the name). This will tell Git to ignore all files under Library/ at the root of the project.

If this doesn't work means that you have a different folder structure. Feel free to send us a screenshot of your project's hierarchy and we'll tell you exactly what to modify in the gitignore.

The default .gitignore I guess it was automatically created from github upon repository creation.

The added .gitignore was created by me (.gitignore) and I have put it inside the Assets folder.


I just checked the github's gitignore project and they changed the folder to only root folders on May 23rd.

This new .gitignore file has Library as only root folder and this will fix the Tokenizer and Parser class problem.

I could change the main .gitignore with that one.


Wouldn't it be easier for the GC Library folder to change name so that github (even with older .gitingore files) won't have any problems?

What about the .unitypackage files? Aren't they needed?

+1

Great! Yeah, modifying the root .gitignore should suffice. As for changing the name of Library/ folder, it would, but would give compatibility problems when updating. The way Unity updates a package is by looking at the ID of the Metafiles. If the ID already exists in a project (even though it's in another folder) and the hash of the class is the same (there have been no changes), the file is not updated. Hence, it would leave the Tokenizer and Parser classes where they are even if we moved them in an update.

Despite this, Library is a common name and the problem should be fixed modifying the .gitignore file, not the other way around.

Regarding the .unitypackage files, don't worry about them. It's okay not to include them. They are probably the Game Creator update file and the Examples modules. These are not required as they can be downloaded again from the Asset Store. If you want to be 100% sure, let us know the full path and we'll assert that indeed they are not required, or are something else.

+1

I will give a shot to updating the master .gitignore and check if everything works as expected.

I didn't know how Unity updater works. Thanks for the info.

As for the .unitypackage files you are correct.
The one is this one: Assets\Plugins\GameCreatorData\Modules\com.gamecreator.examples.core\com.gamecreator.examples.core.unitypackage

and the other is: Assets\Plugins\GameCreatorUpdate\Data\Package.unitypackage

Edit: you could make an FAQ about this, because not all projects will be using the latest .gitignore and will have problem with the Library folder.

In my gitignore, I changed [Ll]ibrary/ to /[Ll]ibrary/ and now I have a bunch of large files I have to track with Git LFS, however  there seems to be some meta files with no extensions so I don't know how to add these to the Git LFS list.

+1

That's because you're ignoring the /Library/ directory, but the root of your project is not the project itself, but the parent folder of it. So, instead of tracking /Library/ change it to:

/WaveSurvival/[Ll]ibrary/

Do the same with the rest of the root folders (/Temp, /Meta, ...). By the way, good to see you're using LFS :-)