LoginSignup
8
6

More than 5 years have passed since last update.

Unityで既に作ったProjectを、Bitbucket( + SourceTree)で管理

Last updated at Posted at 2017-09-04

はじめに

備忘録。
いつもこれ時間かかるのでメモしておく。一部無駄な作業あるかも。

とりあえずUnityでためしに作業してて
「オッケー、これそこそこ出来たからbitbucketで管理すっかー」というときに、どうすればSourceTree経由で管理できるかを書いてみた。

Bitbucketにログイン

Bitbucketでリポジトリを作成。

SourceTree側の設定

Repositoryを作成

LocalでもRemoteでもなく、単にCreate

保存先のパス : UnityのProjectフォルダを選択
名前 : 勝手にセットされる
Git
次のアカウントでリポジトリを作成 : OFF

image.png

.ignoreファイルを用意

(2017/09/17更新)親切な方に以下のオススメを教えていただきました。是非こちらを使いましょう
https://github.com/github/gitignore/blob/master/Unity.gitignore

(以下のgitignoreは古い情報です)
以下のような感じに (どっかからコピーしてきた奴。使わせてくださった方ありがとうございます)

/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj

# Unity3D generated meta files
*.pidb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

全てのファイルをInitial commitする

とりあえずlocalでcommit

全てのファイルをPushする

リモート設定で以下を入れる

image.png

それが終わったらPushする。

おそらくここでSSHがどうたらと言われてけられるので、以下の設定を入れる。

再びBitbucketにログイン

リポジトリのところの SSHをHTTPSに変更

image.png

再びPUSHでOKのはず。

最後に

bitbucket上でファイルが見えるかどうか確認。

ファイルがあればOK。
後は別PCから作業したい場合は、CloneすればOK.

8
6
1

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
8
6