doitian/unity-git-hooks
소개
Git hooks for Unity3D project
창작 및 미디어What you can do
- Delete empty asset directories after checkout and merge. Unity keep generating meta file for empty asset directory, but git does not trace directory.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalUnity 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
Testing
This project includes automated tests that work on Linux, macOS, and Windows.
To run tests locally:
python3 test_hooks.py
The tests are automatically run on GitHub Actions for all three platforms.
관련 프로젝트 살펴보기
불러오는 중…