Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Version Control

Introduction to Version Control

Lightning talk on version control from Rails Girls London.

Frederick Cheung

April 20, 2013
Tweet

More Decks by Frederick Cheung

Other Decks in Technology

Transcript

  1. Saving our bacon • Store your code securely • Throw

    away a change that doesn’t work • Find an older version that works • Find what change caused a problem
  2. Working with others • Allow people to work together without

    conflict • Avoid fragmentation of the codebase • Track who changed what, when, why
  3. Experimenting in isolation • You don’t want to release a

    half done or experimental feature • Create a copy of your codebase: a branch • When that feature is done, you merge that branch
  4. Lingo • You store code in a repository • You

    checkout code from a repository • You commit changes back to the repository • When you commit a change you write a commit message explaining your changes
  5. Keep commits small and focussed • Fix 1 bug •

    Add 1 feature • Not all the work from 1 day
  6. Commit messages are letters to your future self • Explain

    what you are doing, and why you are doing • 1 line summary, plus longer discussion if needed
  7. A bad commit message • Doesn’t tell you why you

    made the change. • Doesn’t describe what the change was • Won’t make much sense 6 months from now Twiddle some CSS
  8. A better commit message Fixed homepage rendering bug on firefox

    16 Firefox incorrectly calculates padding when nesting a something element in a something else element.
  9. There are many revision control systems • git, mercurial, bazaar,

    svn, darcs, perforce etc. • git is the most popular in the rails community
  10. Where to go from here • Install git! • Free

    git hosting at github.com • The git book - http://git-scm.com/book • GUIs: Tower, github for mac/windows