Git and Distributed Source Control – We Will Cover – What is source control?



Git and Distributed Source Control – We Will Cover – What is source control?

0 0


git-presentation


On Github broderboy / git-presentation

Git and Distributed Source Control

We Will Cover

  • What is traditional source control?
  • How does distributed differ?
  • Why Git?
  • Git at Ai

What is source control?

  • Central location to store code
  • Version files
  • Branching: Release and feature management

Why do we need source control?

Why do we need source control?

Backups

In case a dev's computer crashes

Why do we need source control?

Redundancy

In case a dev is stuck at home

Why do we need source control?

Parallel Coding

  • Dev's work on the same features at the same time.
  • Merges changes in the same file

Why do we need source control?

Deploys

NEVER COWBOY CODE PROD!

Traditional Source Control

  • Everyone has the same copy as the repo
  • What if you want to commit code that isn't 100% to test diff options? or roll back

Traditional Source Control

  • svn update
  • svn commit
  • svn merge
  • svn copy
  • svn update - pull changes down from the repository
  • svn commit - send files to the repo
  • svn merge - merge files (or "branches")
  • svn copy - copy a file or folder structure (into a "branch")

Traditional Source Control

Branching and Merging

SVN is awefull at complex merges and change tracking

Distributed Source Control

Distributed Source Control

  • Local Commits
  • True Branching
  • Smarter Merging
  • Staging
  • Can test changes/rollback locally
  • SVN copies a whole folder structure to "branch." Git creates true deltas
  • MUCH smarter merging. If you move a method, it will understand you did that vs a delete/create
  • Makes it easy to not commit everything

Distributed Source Control

  • git pull
  • git add
  • git commit
  • git branch
  • git checkout
  • git merge
  • git remote
  • git pull - pull changes from "central" repo
  • git add - add a file to "stage" for commit
  • git commit - commit stages changes
  • git branch - create a branch
  • git branch - switch to a branch
  • git merge - merge changes between branches
  • git remote - configure remote repositories

Why Git?

  • Easy
  • Most widely used
  • Wider library of available hooks
  • More code review tools
  • Easy
  • Most widely used
  • Hooks: pre commit for validation (linting, etc)
  • Hooks: post commit for automated testing
  • Hooks: push hooks for deploys
  • CODE REVIEWS ARE COMING

Demo!

try.github.com

git.my.ai

Gitorious setup

Developer sets up keys (new, or reuse Amazon/Github) Have Rush set up a new repo Initial commit or clone

Tools

Branching Strategy

  • Initial dev on master
  • Post launch, prod lives on master
  • Each new release gets its own branch

Helpful links

Questions?