Git and Github.com

        Jason Noble
instructor@jasonnoble.org
What is Revision Control?
• Keeps track of changes over time
• Allows you to go back in time
• Helps prevent code from “disappearing”
Revision Control Systems
• cp –R source_dir source_dir-2013.02.20.12.18.52
• Mark Rochkind creates Source Code Control System
  (SCCS) in 1972
• Walter Tichy releases Revision Control System (RCS)
  in 1982 (still actively maintained)
• CVS introduced in 1986 (handles editing multiple
  files at once)
• Commercial systems: ClearCase, VSS and Perforce
Revision Control Systems (cont)
• Subversion (SVN) came out in 2000. Designed to be
  mostly compatible with existing CVS projects.
   – Offers atomic commits (CVS did not)
   – Keeps track of file renames and moves
   – Branching / Tagging is expensive (copies all files)
   – Tags are modifiable
Revision Control Systems (cont)
• Git introduced in 2005
  – Linux kernel used BitKeeper (commercial
    software) because it was free for OSS
  – Bitkeeper started charging, so Linus Torvalds
    wrote a compatible program (Git)
• Mercurial (similar to Git) was also created
  because of the BitKeeper license change
Features of Git
• Git has a strong emphasis on non-linear
  development
• Branching and merging is easy
• Auditing of history
  – If the code in a commit changes, the SHA-1 changes
  – Once published, it prevents history changes without
    people noticing
• Distributed Development is the #1 selling point
Git 101
• Setup central “blessed” repository
  – Each developer downloads a copy
  – Developer can do local development without
    affecting other developers
• Branching is cheap
  – git checkout -b branch_name
Getting started with Git
• mkdir test_app
• cd test_app
• vi hello_world.rb
       #!/usr/bin/env ruby
       puts “Hello World”
•   git init .
•   git status
•   git add hello_world.rb
•   git commit –m ‘Added hello_world.rb’
Github
•   Github.com is a website that hosts Git repos
•   Allows you to share your code with others
•   Easy Forking / Cloning of existing repos
•   Provides an easy to use website for hosting
    your software projects
Create New Repo on Github
• Visit https://github.com
    – Login if necessary
•   Click New Repository
•   Enter repository name, description
•   Click Create repository
•   Follow directions
Additional Hands on Training
•   Tonight from 6:30 to 8:30pm
•   Bring a laptop with Git installed
•   Signup for a Github.com account
•   Hands on instructor led tutorial
    – TAs will be available to assist
• http://www.meetup.com/DaVinci-
  Coders/events/104098422/

Davinci git brown_bag

  • 1.
    Git and Github.com Jason Noble instructor@jasonnoble.org
  • 2.
    What is RevisionControl? • Keeps track of changes over time • Allows you to go back in time • Helps prevent code from “disappearing”
  • 3.
    Revision Control Systems •cp –R source_dir source_dir-2013.02.20.12.18.52 • Mark Rochkind creates Source Code Control System (SCCS) in 1972 • Walter Tichy releases Revision Control System (RCS) in 1982 (still actively maintained) • CVS introduced in 1986 (handles editing multiple files at once) • Commercial systems: ClearCase, VSS and Perforce
  • 4.
    Revision Control Systems(cont) • Subversion (SVN) came out in 2000. Designed to be mostly compatible with existing CVS projects. – Offers atomic commits (CVS did not) – Keeps track of file renames and moves – Branching / Tagging is expensive (copies all files) – Tags are modifiable
  • 5.
    Revision Control Systems(cont) • Git introduced in 2005 – Linux kernel used BitKeeper (commercial software) because it was free for OSS – Bitkeeper started charging, so Linus Torvalds wrote a compatible program (Git) • Mercurial (similar to Git) was also created because of the BitKeeper license change
  • 6.
    Features of Git •Git has a strong emphasis on non-linear development • Branching and merging is easy • Auditing of history – If the code in a commit changes, the SHA-1 changes – Once published, it prevents history changes without people noticing • Distributed Development is the #1 selling point
  • 7.
    Git 101 • Setupcentral “blessed” repository – Each developer downloads a copy – Developer can do local development without affecting other developers • Branching is cheap – git checkout -b branch_name
  • 8.
    Getting started withGit • mkdir test_app • cd test_app • vi hello_world.rb #!/usr/bin/env ruby puts “Hello World” • git init . • git status • git add hello_world.rb • git commit –m ‘Added hello_world.rb’
  • 9.
    Github • Github.com is a website that hosts Git repos • Allows you to share your code with others • Easy Forking / Cloning of existing repos • Provides an easy to use website for hosting your software projects
  • 10.
    Create New Repoon Github • Visit https://github.com – Login if necessary • Click New Repository • Enter repository name, description • Click Create repository • Follow directions
  • 11.
    Additional Hands onTraining • Tonight from 6:30 to 8:30pm • Bring a laptop with Git installed • Signup for a Github.com account • Hands on instructor led tutorial – TAs will be available to assist • http://www.meetup.com/DaVinci- Coders/events/104098422/