My team is using GitHub to hold our Unity project. So far, it’s been a struggle. We have all used GitHub before but only for individual projects or small group assignments. We have never worked on a large project – particularly a Unity project – on GitHub before. Throughout the past week, we have done a lot of googling and trial-and-error to figure out how to push and pull a Unity project to and from GitHub.
Here are some things I learned about using Unity and GitHub:
- Unity creates specific UserSettings for each user when they work on a Unity project.
- These settings include user specific IDs and paths to files on personal computers. Due to each person having a different user ID and computer, the UserSettings must be different for each person working on a Unity project.
- You must do thorough research on what goes into a gitignore meant for Unity projects.
- When one of my teammates created our repository, she looked up how to organize files for Unity but the gitignore she found didn’t ignore UserSettings. As a result, whenever we pushed our files into main, we kept updating the UserSettings file. As stated earlier, UserSettings must be different for each person. Later on, we found an updated gitignore that ignored UserSettings and realized that UserSettings cannot be changed person-to-person.
- If you change your gitignore after files were already uploaded to GitHub, you must delete the files you want to ignore in the main branch.
- In our case, we needed to delete the UserSettings files. It took us an hour in a video meeting before figuring out why pushing and pulling after updating the gitignore still caused problems. We still had the old UserSettings on the main branch and needed to delete that directory.
- You cannot switch branches while the Unity Editor is open.
- For nearly a day, I couldn’t figure out why sometimes I could switch branches and sometimes I could not. I just had to close the Unity Editor.
It’s been an interesting week! We all hoped that GitHub would be straightforward to use. I suppose this past week has been a small taste of the real world. After all, once I graduate and get a job, I will likely be working with teams while using new tools. Struggling with new tools is part of the experience of learning how to use new tools!