https://github.com/maoyeedy/unitysetup
Setup your Unity Projects to work better with Git.
https://github.com/maoyeedy/unitysetup
git github hooks merge powershell pwsh submodule submodules unity unity3d vcs
Last synced: about 1 month ago
JSON representation
Setup your Unity Projects to work better with Git.
- Host: GitHub
- URL: https://github.com/maoyeedy/unitysetup
- Owner: Maoyeedy
- Created: 2025-04-25T21:08:18.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2025-04-28T00:49:15.000Z (about 1 month ago)
- Last Synced: 2025-04-28T01:32:07.887Z (about 1 month ago)
- Topics: git, github, hooks, merge, powershell, pwsh, submodule, submodules, unity, unity3d, vcs
- Language: PowerShell
- Homepage:
- Size: 1.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity Project Setup Scripts
Make Unity Projects work better with VCS.

## What they do
- Add [mergetool](Scripts/setup-unityyamlmerge.ps1) `unityyamlmerge` to `.git/config` (to be used with `.gitattributes`)
- Add [mergerules](Scripts/mergerules.txt) to make `unityyamlmerge` ignore negligible differences. [(Source)](https://docs.unity3d.com/Manual/SmartMerge.html)
- Force `git pull` to use rebase (for cleaner commit history)
- Auto-Update submodules after `git pull/merge`(Details can be found in each `Scripts/*.ps1`, you may modify them to your liking.)
## Installation
Download as zip, and extract to Unity project root.
Or clone the repository:
```powershell
cd $UnityProjectRoot
git clone https://www.github.com/Maoyeedy/UnityProjectSetupScripts.git .setup
rm -r -fo .setup/.git
```Or add as submodule:
```powershell
git submodule add https://www.github.com/Maoyeedy/UnityProjectSetupScripts.git .setup
```Or use degit:
```powershell
degit Maoyeedy/UnityProjectSetupScripts .setup
```## Usage
### Recommended
Double-click `Setup.bat` - it'll launch powershell with admin rights and run everything.### Manually
```powershell
# Launch new admin powershell with this
& ./.setup/Setup.bat# Run each script separately
powershell -NoProfile ./.setup/Scripts/setup-unityyamlmerge.ps1
```## Troubleshooting
- Unity Hub should be installed, as I use `$env:APPDATA\UnityHub\secondaryInstallPath.json` to retrieve installation paths.
- Unity and Git need to be installed, of course.## TODO
- [ ] Add `--verbose` argument.
- [ ] Add more null/return checks.
- [ ] Make `Setup.bat` has interactive 'which scripts to run' toggles.
- [ ] Make it work on Linux and MacOS.
- [ ] Make it able to run with `irm | iex`