In this class I ask you to host your games on GitHub. This will allow you to share files and minimize damage when something breaks in your project. Follow the setup instructions below to create a remote repository on GitHub and tie it to your local Unity project.
We first need a place on GitHub’s servers to store our project. This is the central location to which you will push your changes and pull your teammates’ changes. Follow these steps to create your so-called remote repository:
Now let’s jump to the local machine. You should have already created a Unity project that you want to get under version control. Please follow these steps to prepare that Unity project for hosting on GitHub:
.gitignorefile with these contents:
/[Ll]ibrary/ /[Tt]emp/ /[Oo]bj/ /[Bb]uild/ /[Bb]uilds/ # Autogenerated VS/MD solution and project files *.csproj *.unityproj *.sln *.suo *.tmp *.user *.userprefs *.pidb *.booproj # Unity3D generated meta files *.pidb.meta # Unity3D Generated File On Crash Reports sysinfo.txt
Next you’ll need a Git client. I recommend GitHub Desktop for macOS and Windows. Let’s have it preside over the wedding between our remote repository and our local project. Only one team member completes the following steps:
.gitignore. Type a message like
"Prime repository"in the Summary box and click Commit to master.
repo, of course, will be your actual username and repository name.
Afterward, the rest of the team follows these steps:
Now, everyone should have a clone or checkout of the remote repository.
Henceforth, one should follow this workflow to keep files in sync:
Steady adherence to this workflow will minimize headache.