Slide 1

Slide 1 text

in 5 minutes r2d.to/gitstart

Slide 2

Slide 2 text

snapshots

Slide 3

Slide 3 text

snapshots

Slide 4

Slide 4 text

git-scm.com

Slide 5

Slide 5 text

✓ what files have changed ✓ who made those changes ✓ when the changes were made ✓ how those changed files differ ✓ why they were changed (hopefully) version control

Slide 6

Slide 6 text

wikipedia record of changes to articles over time

Slide 7

Slide 7 text

✓free & open source ✓local & distributed ✓fast & secure ✓stable & popular what’s so great about git?

Slide 8

Slide 8 text

getting git installing it baked right in textmate bundle xcode and more! eclipse plugin use homebrew mxcl.github.com/homebrew use apt-get or yum download it git-scm.com/downloads

Slide 9

Slide 9 text

basic workflow create/ clone repository make changes commit changes stage changes 1 2 3 4

Slide 10

Slide 10 text

photo credit: muy yum (flic.kr/p/7ByV6Y) stage work area git

Slide 11

Slide 11 text

git basics

Slide 12

Slide 12 text

creating a repository $  cd  myproject $  git  init

Slide 13

Slide 13 text

myproject/.git/ don’t touch these files!

Slide 14

Slide 14 text

cloning a repository $  git  clone  https://github.com/ progit/progit.git folder or URL the location can be a folder or url

Slide 15

Slide 15 text

staging changes $  git  add  myfile.html $  git  add  css/* you have to stage your changes each time you commit!

Slide 16

Slide 16 text

committing changes $  git  commit  -­‐m  "Added   new  file,  myfile.html,   to  repo."

Slide 17

Slide 17 text

other commands $  git  log $  git  diff  a65fe40 $  git  rm $  git  mv commit hash

Slide 18

Slide 18 text

.gitignore source/* *.temp nuclear-­‐launch-­‐codes.txt put files, folders and patterns in this file to tell git to ignore them.

Slide 19

Slide 19 text

branching & merging master development feature

Slide 20

Slide 20 text

branching $  git  branch  child $  git  checkout  child 1. create child branch 2. check out child branch 3. work on new branch

Slide 21

Slide 21 text

merging $  git  checkout  parent $  git  merge  child 1. check out parent branch 2. merge child branch into parent

Slide 22

Slide 22 text

tagging $  git  tag  -­‐a  v1.0  -­‐m  "Product  release" $  git  tag  -­‐a  ronburgundy  -­‐m  "Brick      killed  a  guy  with  a  trident." master development v1.0

Slide 23

Slide 23 text

distributed git shared repository developer developer developer $  git  pull  origin  master $  git  push  origin  master

Slide 24

Slide 24 text

further reading

Slide 25

Slide 25 text

get started with git alistapart.com/articles/get-started-with-git

Slide 26

Slide 26 text

Version Control with Git 2nd. Edition by Loeliger & McCullough © 2012 O’Reilly Media ISBN 978-1-4493-1638-9 r2d.to/oreillygitbook

Slide 27

Slide 27 text

✓git-scm.com/book ✓git-scm.com/videos ✓gitready.com ✓gitref.org ✓gitcasts.com ✓gitimmersion.com ✓try.github.com ✓help.github.com ✓codeschool.com/ courses/git-real useful links

Slide 28

Slide 28 text

rob dumas chicago public library @stray thank you, code4lib! r2d.to/gitstart