In what files does Unity store relations between GameObjects and the public vars in scripts they are attached to?

After every commit we lose a lot of connections between objects in scene hierarchies and scripts that should hold a reference to them in public vars. Which files govern this? We probably mistakenly added something to our ignore lists.

They are stored in the scene file. The meta files maintain the ID of each file in your project. Make sure the Assets and ProjectSettings folders are under version control. The Library and Temp folders should always be excluded. Make sure Version Control is set to “Visible Meta Files” in Edit → Project Settings → Editor. Setting Asset Serialization to “Force Text” also helps, but is not necessary.

For more information on external version control see