{"id":26673617,"url":"https://github.com/networm/unitygithooks","last_synced_at":"2025-04-12T06:14:01.197Z","repository":{"id":139107897,"uuid":"61978331","full_name":"networm/UnityGitHooks","owner":"networm","description":"Remove empty directories after git checkout for Unity","archived":false,"fork":false,"pushed_at":"2018-10-17T14:48:17.000Z","size":6,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T06:13:19.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-26T07:19:02.000Z","updated_at":"2023-04-26T10:19:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"5288f12c-4112-4b70-8857-2c8a6a21ae54","html_url":"https://github.com/networm/UnityGitHooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networm%2FUnityGitHooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networm%2FUnityGitHooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networm%2FUnityGitHooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networm%2FUnityGitHooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networm","download_url":"https://codeload.github.com/networm/UnityGitHooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525138,"owners_count":21118619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T01:36:59.309Z","updated_at":"2025-04-12T06:14:01.180Z","avatar_url":"https://github.com/networm.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Git hooks\nGit won't tracked directory changes so you need remove them yourself after checkout.\nUnity would generate `.meta` file for every file and directory.\nSo these hooks use to remove empty directory and its `.meta` file for consistency.\n\n## Environment\n\n- Git for Windows\n- Git on macOS\n\n## Usage\nJust copy `install-hooks.sh` and `hooks` directory to your git repository, then run `install-hooks.sh`.\n\n## Notes\n* file mode\n\n  `hooks/post-checkout` and `hooks/post-merge` don't set executable attribute but set when run `install-hooks.sh`.\n  It's because of `Git for Windows`. `Git for Windows` doesn't set `core.filemode` to `true`.\n  So every file is always `644`.\n\n* depth first\n\n  When find empty directories, we need find to perform depth-first traversal.\n  And we need delete every empty directory when encountered.\n  So that we could remove nested empty directories.\n\n* useless files\n\n  There are too many useless files exist in working dir, include `.DS_Store`, `Thumbs.db`, `Desktop.ini`, `desktop.ini`.\n  They are generated occasionally by Operating System. These files are usually ignored in `.gitignore` file.\n  Then Git treat containing directory didn't exist but Unity don't think so. Unity would generate corresponding `.meta` for directory.\n  We need delete these useless ignored files.\n\n## Test\nYou could run `hooks/testcase.sh` to build test directory structure.\nAnd then you could run `hooks/post-checkout.sh` or `hooks/post-merge` to remove empty directories.\n\n## Reference\n* [3pjgames/unity-git-hooks: Git hooks for Unity3D project](https://github.com/3pjgames/unity-git-hooks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworm%2Funitygithooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworm%2Funitygithooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworm%2Funitygithooks/lists"}