Check the PDF for a detailed description of how the project was put together from start to finish.
You should only have to do this part once.
Note you can follow these lengthier instructions if you want
- Download and install Git LFS (Large File Storage) here.
- Clone the repository using either the GitHub GUI or in Powershell using
git clone git@github.com:mhueter/cs-419-project.git
. - Copy all of the project files into the newly-cloned repository folder on your machine.
- Open the project folder in Unity.
- In the Unity menu click
Edit -> Project Settings -> Editor
- In the Editor menu, under
Version Control - Mode
selectVisible Meta Files
. - In the Editor menu, under
Asset Serialization - Mode
selectForce Text
.
Set Up Git Config to Prevent Merge Conflicts
- In this repository, go into the hidden folder
.git
- In that folder, open the
config
file in a text editor. - Paste the following:
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
keepTemporaries = true
keepBackup = false
path = 'C:\\Program Files\\Unity\\Editor\\Data\\Tools\\UnityYAMLMerge.exe'
cmd = 'C:\\Program Files\\Unity\\Editor\\Data\\Tools\\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
- This will instruct your repo to use the unityyamlmerge tool to try and prevet scene merge conflicts.
- There might be extraneous files after merging such as
.orig
. Feel free to delete them.
Note: You can edit your global config if you don't feel like changing this every time you have a new Unity project
Click Here for more information / instructions on how I figured this out.
Now You're set up!
So we're using Git LFS! I have an account with them and we can currently store 50 GB, which our project will never get that big.
Basically what this means is that large files are automatically put into the LFS storage so we won't ever hit our GitHub repository size limit.
Implications: after you initially copy the project contents from Google Drive, we never have to use it again for version control. We can use git / GitHub from here on out. I think we should use Google Drive for assets that we want to show each other before they actually get added to our project. Once you want them in the project, just import them normally and then commit/push the changes.
Note: I'm going to demonstrate command line (CLI) commands but you can do the same things with the GUI
git checkout master
andgit pull
to get the latest updates.- Make sure your work is on a branch. To create a branch
git checkout -b <branch-name>
- Check GitHub for any open Pull Requests that other members want.
- While you work, occasionally type
git status
to see what you've changed. If you want to view your changes per file, typegit diff <filename>
. - When you get to a point where you've changed stuff and made something work,
git add .
to stage all the changes in your current directory. - Right after staging the changes, use
git commit -m "<your-commit-message-here>"
. - Committing keeps track of your progress locally.
git pull
to get latest updates on your branch (in case someone is also working on it remotely)git push
to publish your local changes up to GitHub so everyone else can be up-to-date