basic version control using git - bengkel gamelan
TRANSCRIPT
Version Control System Using Git
With Little Explanations About How To Setup It In Unity
Dennis Adriansyah Ganda Amagine Interactive
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
But Unlike game saving system, with version control you can go back to every point of your progress
S1 S2 S3 S4 S5
Types of Version Control
Git Mercurial
SVN Perforce
Now Let’s Talk Git
Decentralized Easy to use and setup Lots support
Choose Your Weapon
Terminal /Command Line Graphical User Interaface (GUI)
I Personally like this one better, and here I will explain this one
Preparation
Windows users need to download Git-Scm First
Linux / Mac user can use terminal directly
https://git-scm.com/download/win
Basic Git Functions
Initialization Staging Commiting Branching Merging Conflict Resolving
Single Player Mode Multiplayer Mode
Clone Fetch Push Pull
DEMO
.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
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!
My own .gitignore for Unity
Download Here : https://gist.github.com/fugogugo/fbe1aabd3f06aec0e9c4
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)