Last updated: December 26, 2022 by @abmarnie
Concise Version
Initial Setup
- Sign up for GitHub.
2-7. Download, install, and setup Git and Git LFS.
- Make a local Git repo inside your Unity project using
git init
.
9-12. Add and commit the .gitignore, .gitattributes, and .gitconfig files.
- Create a new remote GitHub repo, and link it your local Git repo.
- (Optional). Invite collaborators.
- (Optional). Write a good README (project style guide, coding standards).
Everyday Workflow
- Open Git Bash and navigate to your Unity project folder (your Git repo).
- Keep your local repository up-to-date with any changes made by your collaborators using the
git pull
command.
- Use the Unity Editor to work on your project and save your work frequently. Communicate with your team to avoid merge conflicts.
- Check the status of your repository using
git status
when you reach a stopping point.
- Commit and push your changes using the following commands (in order):
git pull
, git add .
, git commit -m "description of changes"
, git push
.
Introduction and Prerequisites
This is a short guide for those who want to quickly setup a distributed version control system using Git and GitHub in their next Unity project. It is geared towards people who have never used Git or GitHub before. Some prerequisites are:
- A Unity project set up. See here.