An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

# Unity Project Setup Scripts

Make Unity Projects work better with VCS.

![Screenshot](Public/carbon-light.png)

## 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`