Hello Club Members!
Here’s a helpful snippet from an email I sent out to my mentor group last quarter about how to setup Unity with Git and Git LFS, probably damned helpful for anyone fumbling right now.
Before we get started in on what the hell version control is, we need to enable Unity to allow for it to even work. If you go to, Edit -> Project Settings -> Editor, you should see an “Editor Settings” pane under the Inspector in the Unity client. There is a drop down menu that’s labeled “mode” under “Version Control” which you need to set to “Visible Meta Files.” In short Unity keeps track of every file in a project via a unique identifier which is stored in that meta file.
So, if you plan on using version control you have to use that otherwise Unity will see your files and deem them as being new instead of already being used in your project and well it’s a whole load of pain.
Git and Version Control
For those who aren’t yet initiated into version control, in short it refers to the idea of keeping multiple versions of your files in a way in which you can switch between them. This is mainly designed to solve the following problem.
You’re working on your game and suddenly want to make a HUGE change. Say you want to radically change how the controls work. You go from keyboard and mouse to controller. This requires you to destroy all of your support for the keyboard and mouse controls (a contrived situation I know). You don’t have enough undoes in Unity to go back after you’ve done all your changes. Other than copying the whole project folder over to keep the “current version,” you don’t really have many other options.
That being said, what I recommend for project is Git which is a version control system that has large support in the coding community and thus will be a lot easier to use. In short, how it works is you turn a directory into a “repository” whose contents will be tracked. As to exactly how it works, here’s a link to a website that should teach you Git in about 15 minutes.
GitHub, Git LFS
GitHub is a website that lets you host your repositories remotely and thus in case things explode on your end you always have a back up of your project. It also has support for the Git LFS plugin which in short makes dealing with large files a lot less painful.
In short usually when you clone a repository you end up downloading the whole thing, which is fine for small files but with larger non-code asset files this becomes a problem quickly so Git LFS solves this by only downloading a file tracked by it only if you are checking out.
Here’s a link to GitHub’s training video for it and the website which has documentation on how to install it.