UnityプロジェクトをGitで管理する
UnityプロジェクトをGitで管理 - Qiita
画像や音声ファイルなどのバイナリデータはファイルサイズが大きくなりがちなのでGit LFSトラック対象とする
https://twitter.com/izm/status/1441067373117644803
Unity公式
Unity - Manual: Using external version control systems with Unity(2019.3)
Before checking your project in, you have to tell Unity to modify the project structure slightly to make it compatible with storing assets in an external version control system. This is done by selecting Edit->Project Settings->Editor in the application menu and enabling External Version Control support by selecting Visible Meta Files in the dropdown for Version Control. This will show a text file for every asset in the Assets directory containing the necessary bookkeeping information required by Unity.The files will have a .meta file extension with the first part being the full file name of the asset it is associated with. Moving and renaming assets within Unity should also update the relevant .meta files. However, if you move or rename assets from an external tool, make sure to syncronize the relevant .meta files as well.
.metaはアセットに何が必要なのか管理する情報が入っているらしい
https://gyazo.com/cd2b4e83d9e4670e44330f616fe0b228
デフォルトでこれだった
When checking the project into a version control system, you should add the Assets, Packages and the ProjectSettings directories to the system. The Library directory should be completely ignored - when using .meta files, it’s only a local cache of imported assets.
https://gyazo.com/f2ba156a5ab57b81b23e93f59863fdb4
When creating new assets, make sure both the asset itself and the associated .meta file is added to version control.
assetに対応する.metaはバージョン管理が必要
.gitignoreの設定
https://github.com/github/gitignore/blob/main/Unity.gitignore を使えばいい
https://learn.unity.com/tutorial/set-up-version-control#60b0179dedbc2a54fb1c0f81 だとGithub Desktopの自動生成を使っている
Unity向け .gitignoreの設定について - Qiita
ignoreしたほうが良いもの
*.log
*.pyc:pythonプラグインで生成されるbytecodeのcache
https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files では
gitignore/Unity.gitignore at master · github/gitignore · GitHub
Asssetのignoreの意味がわからなかったけどこれをよんでわかった
Modified comment on Asset meta data ignore to better explain usage. by helioseven · Pull Request #3249 · github/gitignore · GitHub
https://www.toptal.com/developers/gitignore
が進められている
両者の内容はUnityの場合、全く同じだった
https://www.toptal.com/developers/gitignore/api/unity
https://github.com/github/gitignore/blob/main/Unity.gitignore
【Unity/Git】Unityでチーム開発をする(1) 概要と初期設定編 - Qiita