Git results in missing scripts

I followed these instructions to make a Github repository for my Unity project. However, after pushing and cloning it somewhere else, in a script which is loaded in a scene I get these (on the right pane):

in place of e.g.

Could it be that I’m ignoring some files that are required to keep track of the configuration of scripts (or what it is called - shown above in the screenshots)? Any other ideas what can have gone wrong?

That would happen if the meta files were not added to the repository. If you followed the instructions you posted, they should be there, but make sure that ARUWPController.cs.meta has been added.

The meta file of a .cs file contains it’s guid. The guid is what’s used to store which scripts are attached to which GameObject. So if the meta file is missing, Unity generates a new one, and any links to that script disappears.

An alternative is that Unity’s unable to compile your scripts. In that case, you’d be seeing errors in the console, though.

Thanks! Indeed there was a .gitignore in a subfolder which ignored some meta files!

In my case a collaborator had named the scene object which had the missing script with a space in the name, therefore the meta file also had a space in the name and it seems git couldn’t actually push and subsequently pull the file.