Version control in Game Dev

(or how to not lose everything to a power surge)
What is Version Control
• Wikipedia: “the management of changes to
  documents, computer programs, large web
  sites, and other collections of information.”
• Huh?.. In real people speak?
  – It’s a history of the changes to your work
  – Usually saved on a server somewhere
  – That allows you (or someone else) to get a copy of
    your work as it is/was at some point
Demo
Why should I bother?
•   Helps you track down where bugs came from
•   Lets you take risks
•   Makes it easier to work in a team
•   Backups (stuff happens!)
•   All the cool kids are doing it :P
Which Version Control system?
• Centralized = old school. Everything on the
  server, without access to that, you’re fooked.
  Eg. CVS, SVN, SourceSafe
• Distributed = everyone has a copy of the
  whole repo.. More resilient, can work offline.
  Eg. Git (<3), Mercurial
What should be in Version Control?
• Ideally EVERYTHING you need to recreate the
  project at any given time
• Prefer source assets to output assets (source
  code instead of internal dlls, pdfs instead of
  pngs)
• On large projects, may have to rather keep
  output art assets (gajillion meg multilayer
  pdfs), but then at least back source up
Git: Which tools?
•   Commandline
•   SmartGitHg
•   SourceTree <3 (Windows only in Beta )
•   TortoiseGit (No, no, no. Just don’t do it)
Git terminology
• Repository: where history of work is stored (you
  have one locally, and one or more on remote
  machines).
• Origin: shorthand for “main” remote repository.
  Not really special in any way.
• Commit: state of all your assets at a given point in
  time
• Branch: series of commits
• Master: “main” branch
• Working Copy: assets you’re actually working on
Git workflow
1.   Create new repository
2.   Make code changes
3.   Commit local changes (repeat 2-3)
4.   Pull changes =
     – Fetch changes from remote
     – Merge changes into local
     – Commit merge
5. Test
6. Push changes
7. Repeat from 2
Demo
Unity+Git: specifics
• Set version control mode to met a files (edit-
  >project settings->editor)
• Set up your .gitignore to exclude:
   – Library and temp folders
   – Monodev/Studio project files
   – System files like DS_store & thumbnails
• Metas, metas, metas:
   – If you add an asset, add the meta
   – If you empty a folder, delete the folder and the meta
Where to go to get started?
• Github.com – free public repositories, well
  known, widely used
• Bitbucket.com – free private repositories!! 
• Git-scm.com

Source andassetcontrolingamedev

  • 1.
    Version control inGame Dev (or how to not lose everything to a power surge)
  • 2.
    What is VersionControl • Wikipedia: “the management of changes to documents, computer programs, large web sites, and other collections of information.” • Huh?.. In real people speak? – It’s a history of the changes to your work – Usually saved on a server somewhere – That allows you (or someone else) to get a copy of your work as it is/was at some point
  • 3.
  • 4.
    Why should Ibother? • Helps you track down where bugs came from • Lets you take risks • Makes it easier to work in a team • Backups (stuff happens!) • All the cool kids are doing it :P
  • 5.
    Which Version Controlsystem? • Centralized = old school. Everything on the server, without access to that, you’re fooked. Eg. CVS, SVN, SourceSafe • Distributed = everyone has a copy of the whole repo.. More resilient, can work offline. Eg. Git (<3), Mercurial
  • 6.
    What should bein Version Control? • Ideally EVERYTHING you need to recreate the project at any given time • Prefer source assets to output assets (source code instead of internal dlls, pdfs instead of pngs) • On large projects, may have to rather keep output art assets (gajillion meg multilayer pdfs), but then at least back source up
  • 7.
    Git: Which tools? • Commandline • SmartGitHg • SourceTree <3 (Windows only in Beta ) • TortoiseGit (No, no, no. Just don’t do it)
  • 8.
    Git terminology • Repository:where history of work is stored (you have one locally, and one or more on remote machines). • Origin: shorthand for “main” remote repository. Not really special in any way. • Commit: state of all your assets at a given point in time • Branch: series of commits • Master: “main” branch • Working Copy: assets you’re actually working on
  • 9.
    Git workflow 1. Create new repository 2. Make code changes 3. Commit local changes (repeat 2-3) 4. Pull changes = – Fetch changes from remote – Merge changes into local – Commit merge 5. Test 6. Push changes 7. Repeat from 2
  • 10.
  • 11.
    Unity+Git: specifics • Setversion control mode to met a files (edit- >project settings->editor) • Set up your .gitignore to exclude: – Library and temp folders – Monodev/Studio project files – System files like DS_store & thumbnails • Metas, metas, metas: – If you add an asset, add the meta – If you empty a folder, delete the folder and the meta
  • 12.
    Where to goto get started? • Github.com – free public repositories, well known, widely used • Bitbucket.com – free private repositories!!  • Git-scm.com