// Before you clone the team repo, follow these instructions:
- Install GitHub Desktop, which also installs Git LFS: https://desktop.github.com (if you are using git via command line, install Git LFS: https://git-lfs.com)
- Submit your GitHub username in the Canvas assignment that is titled “Provide your GitHub account Name”
- You will receive an email with permission to access your team’s GitHub repo website
- (for GitHub Desktop) Goto the repo website, click the green Code button, and select “Open with GitHub Desktop” and clone the template project to your local machine (for git command line) Go to GitHub account settings and authorize your SSH key for CWRU SSO URL (https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-an-ssh-key-for-use-with-saml-single-sign-on) and then clone the final project template
Not everyone on your team may have the same path to UnityYAMLMerge (i.e. different operating systems or install locations). Because of this, we suggest you modify your local config to define the "unityyamlmerge" merge tool that this repository points to. To do this:
i. Reveal hidden files on your operating system
- Windows 10: Open the File Explorer application and select View > Options > Change folder and search options and then select the View tab and, in Advanced settings, select Show hidden files, folders, and drives and OK
- Windows 11: Open the File Explorer application and select View > Show > Hidden Items
- MacOS: Click on Finder and press the keyboard combination Shift + Cmd + . (period key)
ii. Open the .git/config file by navigating to your local repo folder, open the hidden .git folder, then open the config file (note: this is different from the .gitconfig file in the repo’s root folder)
iii. Identify your version of unity (e.g. 2022.3.19f1). This will replace the word VERSION in the paths commented below depending on your OS. Then, add the following text to the bottom of the file, replacing <path to UnityYAMLMerge> with the one specific to your OS and Unity version. For instance, in Unity version 2022.3.19f1 on Windows, the last line should be cmd = 'C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.19f1\\Editor\\Data\\Tools\\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
[mergetool "unityyamlmerge"]
trustExitCode = false
#Replace <path to UnityYAMLMerge> in the next line with the following default locations (may be different depending on your Unity installation location)
# Installs using the Unity Hub (Default):
# Win: C:\\Program Files\\Unity\\Hub\\Editor\\VERSION\\Editor\\Data\\Tools\\UnityYAMLMerge.exe
# MacOS: /Applications/Unity/Hub/Editor/VERSION/Unity.app/Contents/Tools/UnityYAMLMerge
# Linux: /home/USERNAME/Unity/Hub/Editor/VERSION/Editor/Data/Tools/UnityYAMLMerge
cmd = '<path to UnityYAMLMerge>' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"iv. Change the Git Config settings to use your local Git config in the menu bar Repository > Repository Settings > Git Config > Use a local Git config > Save.
Download the scripts from the link below and paste them into the hidden folder <your_repo>/.git/hooks/
- Pre-commit: https://github.com/NYUGameCenter/Unity-Git-Config/blob/master/pre-commit
- Post-commit: https://github.com/NYUGameCenter/Unity-Git-Config/blob/master/post-merge On MacOS and Linux, the pre-commit and post-merge files need to be made executable. This involves using terminal (Terminal.app on MacOS) to modify the file permissions for these two files using the following commands.
> cd <local_repo_folder>/.git/hooks
> chmod 755 pre-commit
> chmod 755 post-mergeThis project was created using 2021.3.0f1. When you open this project in Unity, Unity may say that it needs to upgrade the project. Given this is a bare-bones project, this is a safe action and you may allow Unity to continue. Overall, your entire team should be using the same version of Unity.
- Github setup: https://youtu.be/iWniKp_O21o?feature=shared
- Merge conflict resolution: https://youtu.be/vJIjV-GlGFg?feature=shared
I change the README file - JC Toledo
I also changed the README file - John Shi