LoginSignup
26
21

More than 5 years have passed since last update.

Unityの初期プロジェクトのGit設定(2017年末Ver)

Posted at

Unityプロジェクトをチームでgit管理する際の初期設定
単純に推奨のgitignore設定入れるだけとかだと、チームメンバーがcloneした時にそのままひらけないのでその対策。

Unityで空のプロジェクトを作成し、ターミナル等でそのプロジェクトにディレクトリに移動した後に以下を実施する。

.gitignore作成

github推奨のignore設定ファイルから.gitignoreを作成する

$ curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Unity.gitignore

一応現在の状態は以下のような中身

$ cat .gitignore
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*

# Visual Studio 2015 cache directory
/.vs/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb

# Unity3D generated meta files
*.pidb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

空のAssetsディレクトリをコミット内容に含める

チームメンバーが空プロジェクトをcloneする際にAssetsディレクトリが存在しないと、
Unityプロジェクトとして読み込んでくれないので、Assetsディレクトリに.gitkeepを設置

$ touch Assets/.gitkeep

これで、空のUnityプロジェクトをチームメンバーで共有できるので、
リモートリポジトリにプッシュしてcloneしてもらう。

環境

 
名前 バージョン
MacOS Sieera 10.12.6
Unity 2017.1.1f1 Personal
26
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
21