Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doitian/unity-git-hooks
Git hooks for Unity3D project
https://github.com/doitian/unity-git-hooks
Last synced: 13 days ago
JSON representation
Git hooks for Unity3D project
- Host: GitHub
- URL: https://github.com/doitian/unity-git-hooks
- Owner: doitian
- License: mit
- Created: 2014-03-28T07:16:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-05-10T18:13:58.000Z (over 1 year ago)
- Last Synced: 2024-10-13T13:39:56.462Z (26 days ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 320
- Watchers: 16
- Forks: 30
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - unity-git-hooks - Git hooks for Unity project (Git)
README
# Unity Git Hooks
Git hooks for Unity project.
To manage a Unity project, the Assets meta file should also been added to
repository. But sometimes the meta files and the corresponding asset files
and directories are inconsistent, then meta files will lead to conflicts when
a team is collaborating on the same code base.## Features
- Stop committing if meta files and asset files and directories are
inconsistent. If an asset file is added, its meta file and meta files of all
its containing directories should also been added. If a asset file is
deleted, its meta file and meta files of all its empty containing
directories should also been deleted. When meta files are added/deleted,
asset files and directories should also been consistent.
- Delete empty asset directories after checkout and merge. Unity keep
generating meta file for empty asset directory, but git does not trace
directory.## Usage
Copy files `post-checkout` `post-merge` and `pre-commit` to .git/hooks in your
git repository. If you also have hooks defined in these files, append them to
existing files.It is assumed that Assets directory is located in the root directory of the repository. You doesn't need set path to "Assets" folder manually if you "Assets" folder has position in the same folder as ".git". Example:
```
.
+-- ProjectName
| +-- .git
| +-- Assets
```
Otherwise you need set full path relative `.git`. Following example tells the scripts that the assets directory is client/Assets Example:
```
.
+-- ProjectName
| +-- .git
| +-- client
| | +-- Assets
```
```
git config unity3d.assets-dir client/Assets
```