LoginSignup
4
2

More than 5 years have passed since last update.

【Unity】Githubの初期設定をする【Sourcetree】

Posted at

概要

Unityで新しくプロジェクトを始める際に、Github周りの設定をどうすればいいのか毎回迷うのでメモとしてまとめてみました。
もっと良い方法があると思いますが、この方法が参考になれば幸いです。

環境

方法

手順1

  1. Sourcetreeの初期画面に、Unityで作成したプロジェクトのフォルダをドラッグ&ドロップ
  2. ローカルリポジトリを作成
  3. 追加したローカルリポジトリを開く スクリーンショット 2019-05-08 午前9.14.45.png

手順2

設定(右上) -> 高度な設定 -> リポジトリ限定無視リストを編集 (.gitignoreを編集) -> 下のスクリプトをコピペ

[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/

# Never ignore Asset meta data
![Aa]ssets/**/*.meta

# Uncomment this line if you wish to ignore the asset store tools plugin
# [Aa]ssets/AssetStoreTools*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

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

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

# Crashlytics generated file
crashlytics-build.properties

手順3

  1. ブラウザでGithubを開く
  2. Repositoriesに行ってNewを押す
    スクリーンショット 2019-05-08 午前9.38.28.png

  3. Repository nameを入力

  4. リポジトリをpublicにするかprivateにするか選択する
    (Initialize this repository with a README と Add .gitignore と Add a license に関しては何もしない)

  5. Create repository
    スクリーンショット 2019-05-08 午前9.37.20.png

手順4

HTTPSのURLをコピー
スクリーンショット 2019-05-08 午前10.03.50.png

手順5

  1. Sourcetreeに戻り、リポジトリ(画面上) -> リモートを追加
  2. リモートの名前を入力 -> URL欄に先ほどコピーしたURLをペースト -> OK

これで初期設定は完了のはずです。

参考文献

わかばちゃんと学ぶGit使い方入門

4
2
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
4
2