Slide 1

Slide 1 text

Git an introduction

Slide 2

Slide 2 text

Rails Girls ATL

Slide 3

Slide 3 text

[email protected] Emily Price   ✉ Text Text

Slide 4

Slide 4 text

What is git?

Slide 5

Slide 5 text

Git is a distributed version control system

Slide 6

Slide 6 text

a version control system OK, so what is

Slide 7

Slide 7 text

a version control system

Slide 8

Slide 8 text

version snapshot of managed files a version control system

Slide 9

Slide 9 text

version snapshot of managed files control save and retrieve versions a version control system

Slide 10

Slide 10 text

version snapshot of managed files control save and retrieve versions system set of integrated tools a version control system

Slide 11

Slide 11 text

version snapshot of managed files control save and retrieve versions system set of integrated tools a version control system

Slide 12

Slide 12 text

Git is a version control system

Slide 13

Slide 13 text

Git is a set of integrated tools to save and retrieve snapshots of managed files

Slide 14

Slide 14 text

What does it mean that git is distributed?

Slide 15

Slide 15 text

Let’s talk history

Slide 16

Slide 16 text

In the beginning... there was local version control

Slide 17

Slide 17 text

And then for teams... there was central version control

Slide 18

Slide 18 text

Which evolved into... distributed version control

Slide 19

Slide 19 text

What does it mean that git is distributed?

Slide 20

Slide 20 text

What does it mean that git is distributed?

Slide 21

Slide 21 text

What does it mean that git is distributed? No central server necessary

Slide 22

Slide 22 text

What does it mean that git is distributed? No central server necessary Every copy contains full history

Slide 23

Slide 23 text

What does it mean that git is distributed? No central server necessary Every copy contains full history Most operations don’t require network

Slide 24

Slide 24 text

Why use version control?

Slide 25

Slide 25 text

Why use version control?

Slide 26

Slide 26 text

Why use version control? Allow rewinding changes

Slide 27

Slide 27 text

Why use version control? Allow rewinding changes Easier to collaborate

Slide 28

Slide 28 text

Why use version control? Allow rewinding changes Easier to collaborate See when something changed

Slide 29

Slide 29 text

Terminology

Slide 30

Slide 30 text

Git has a lot of terminology

Slide 31

Slide 31 text

repository working directory commit index the full set of files and history lives in .git directory the visible files of your project everything outside of .git a snapshot of your project staging area for next commit

Slide 32

Slide 32 text

remote repository local repository working directory index pull fetch push commit add checkout clone

Slide 33

Slide 33 text

remote repository local repository working directory index pull fetch push commit add checkout clone

Slide 34

Slide 34 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 35

Slide 35 text

remote repository working directory index fetch push commit add checkout clone local repository pull

Slide 36

Slide 36 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 37

Slide 37 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 38

Slide 38 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 39

Slide 39 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 40

Slide 40 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 41

Slide 41 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 42

Slide 42 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 43

Slide 43 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 44

Slide 44 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 45

Slide 45 text

remote repository local repository working directory index fetch push commit add checkout clone pull

Slide 46

Slide 46 text

The anatomy of a commit

Slide 47

Slide 47 text

Every commit is identified by a SHA1 hash

Slide 48

Slide 48 text

A hash function maps data of variable length to data of fixed length, predictably

Slide 49

Slide 49 text

Digest::SHA1.hexdigest('foo') 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 SHA1

Slide 50

Slide 50 text

Git hashes the contents and attributes of a commit

Slide 51

Slide 51 text

Actions contents attributes files and directories changed, added or deleted SHA of parent commit message

Slide 52

Slide 52 text

c14f2de blob a20b616 blob bc4d0fb blob commit tree parent author committer message 000742a 38a0164 1f62407 duien duien ... tree tree blob 38a0164 7095bff bc4d0fb tree blob blob 7095bff c14f2de a20b616

Slide 53

Slide 53 text

Branching and merging

Slide 54

Slide 54 text

time

Slide 55

Slide 55 text

time master HEAD

Slide 56

Slide 56 text

time master HEAD

Slide 57

Slide 57 text

time master HEAD

Slide 58

Slide 58 text

time master HEAD

Slide 59

Slide 59 text

time comments HEAD master

Slide 60

Slide 60 text

time comments HEAD master

Slide 61

Slide 61 text

time comments master HEAD

Slide 62

Slide 62 text

time master HEAD comments

Slide 63

Slide 63 text

time master comments HEAD

Slide 64

Slide 64 text

time master comments HEAD

Slide 65

Slide 65 text

time master comments HEAD

Slide 66

Slide 66 text

time comments master HEAD

Slide 67

Slide 67 text

time master comments HEAD

Slide 68

Slide 68 text

time master comments HEAD

Slide 69

Slide 69 text

time master comments HEAD

Slide 70

Slide 70 text

time master comments HEAD

Slide 71

Slide 71 text

time master comments HEAD

Slide 72

Slide 72 text

time master comments HEAD

Slide 73

Slide 73 text

time master comments HEAD

Slide 74

Slide 74 text

Putting it into practice

Slide 75

Slide 75 text

GitHub has good install guides at help.github.com

Slide 76

Slide 76 text

Make a git repo for your Rails Girls projects

Slide 77

Slide 77 text

DEMO

Slide 78

Slide 78 text

git-scm.com try.github.com help.github.com ndpsoftware.com/git-cheatsheet.html More Resources