basic version control using git - bengkel gamelan

13

Click here to load reader

Upload: gamelanyk

Post on 21-Jan-2018

487 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Basic Version Control Using Git - Bengkel Gamelan

Version Control System Using Git

With Little Explanations About How To Setup It In Unity

Dennis Adriansyah Ganda Amagine Interactive

Page 2: Basic Version Control Using Git - Bengkel Gamelan

Version Control?

It’s pretty much like this :

You play a game, you’ve get a lot of progress in your game, then you’re going to beat a very difficult boss. You save your game in case you’re beaten and want to replay the game with better strategy.http://www-cs-students.stanford.edu/~blynn/gitmagic/ch01.html

Page 3: Basic Version Control Using Git - Bengkel Gamelan

But Unlike game saving system, with version control you can go back to every point of your progress

S1 S2 S3 S4 S5

Page 4: Basic Version Control Using Git - Bengkel Gamelan

Types of Version Control

Git Mercurial

SVN Perforce

Page 5: Basic Version Control Using Git - Bengkel Gamelan

Now Let’s Talk Git

Decentralized Easy to use and setup Lots support

Page 6: Basic Version Control Using Git - Bengkel Gamelan

Choose Your Weapon

Terminal /Command Line Graphical User Interaface (GUI)

I Personally like this one better, and here I will explain this one

Page 7: Basic Version Control Using Git - Bengkel Gamelan

Preparation

Windows users need to download Git-Scm First

Linux / Mac user can use terminal directly

https://git-scm.com/download/win

Page 8: Basic Version Control Using Git - Bengkel Gamelan

Basic Git Functions

Initialization Staging Commiting Branching Merging Conflict Resolving

Single Player Mode Multiplayer Mode

Clone Fetch Push Pull

DEMO

Page 9: Basic Version Control Using Git - Bengkel Gamelan

.gitignore

a.k.a don’t add these things into my repository

DEMO

Computer Generated files Binary Files Build folders Project files library files (dll, jar, etc)

Usually used for

Page 10: Basic Version Control Using Git - Bengkel Gamelan

Git for Unity

1. Create Unity project 2. Open Edit → Project Settings → Editor → Version Control Mode

change setting to “Visible Meta Files” 3. Open Edit → Project Settings → Editor → Asset Serialization Mode

change setting to “Force Text” 4. Create .gitignore files and save it in your root Unity project folder (Unity

generates lots of unnecessary files so .gitignore is important) , check next page for .gitignore samples

5. Create some scenes and scripts, then save all of it 6. Make your first commit 7. Well done now you can work with Git for your Unity projects!

Page 11: Basic Version Control Using Git - Bengkel Gamelan

My own .gitignore for Unity

Download Here : https://gist.github.com/fugogugo/fbe1aabd3f06aec0e9c4

Page 12: Basic Version Control Using Git - Bengkel Gamelan

Tips and tricks

Using version control is all about habit. Git, SVN or any other version control system are just tools ,It will be useless if never use it Commit as often as you can Always have that one stable branch Do experiments in separate branch, merge when finished Conflicts will always happen in some point of your projects, don’t panic, cool your head and resolve it one by one When everything seems so wrong, “git reset - -hard HEAD” Separate branch that contain main gameplay and another branch that has plugins added into it (in app purchases, ads, analytic etc)

Page 13: Basic Version Control Using Git - Bengkel Gamelan

That’s All!

QUESTIONS?

Futher question you can contact me here : [email protected]