Slide 1

Slide 1 text

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

Slide 2

Slide 2 text

WHO DOESN’T USE VERSION CONTROL?

Slide 3

Slide 3 text

VERSION CONTROL WHO?

Slide 4

Slide 4 text

OH BOY.

Slide 5

Slide 5 text

WHY YOU NEED VERSION CONTROL

Slide 6

Slide 6 text

GIT

Slide 7

Slide 7 text

GIT

Slide 8

Slide 8 text

WHY GIT IS AWESOME

Slide 9

Slide 9 text

HOW GIT WORKS

Slide 10

Slide 10 text

WORKING DIRECTORY

Slide 11

Slide 11 text

WORKING DIRECTORY INDEX (STAGING AREA) add

Slide 12

Slide 12 text

WORKING DIRECTORY INDEX (STAGING AREA) LOCAL REPOSITORY add commit

Slide 13

Slide 13 text

WORKING DIRECTORY INDEX (STAGING AREA) LOCAL REPOSITORY REMOTE REPOSITORY add commit push

Slide 14

Slide 14 text

My-Computer: mreidsma$ _

Slide 15

Slide 15 text

My-Computer: mreidsma$ _ SCARY

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

$cd MyAwesomeApp

Slide 18

Slide 18 text

$cd MyAwesomeApp $touch index.html

Slide 19

Slide 19 text

$cd MyAwesomeApp $git init Initialized empty Git repository in /MyAwesomeApp/.git/ $touch index.html

Slide 20

Slide 20 text

$cd MyAwesomeApp $git init Initialized empty Git repository in /MyAwesomeApp/.git/ $git add . $touch index.html

Slide 21

Slide 21 text

$cd MyAwesomeApp $git init Initialized empty Git repository in /MyAwesomeApp/.git/ $git add . $git status # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # #! new file: index.html # $touch index.html

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

$git commit -m “First commit” [master (root-commit) 7ce2952] First commit 1 file changed, 2 insertions(+) create mode 100644 index.html

Slide 24

Slide 24 text

$git commit -m “First commit” $git remote add origin [email protected]:gvsulib/ awesomeapp.git [master (root-commit) 7ce2952] First commit 1 file changed, 2 insertions(+) create mode 100644 index.html

Slide 25

Slide 25 text

$git commit -m “First commit” $git remote add origin [email protected]:gvsulib/ awesomeapp.git [master (root-commit) 7ce2952] First commit 1 file changed, 2 insertions(+) create mode 100644 index.html $git push origin master

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

BRANCHING

Slide 28

Slide 28 text

[master]

Slide 29

Slide 29 text

[master]

Slide 30

Slide 30 text

[master]

Slide 31

Slide 31 text

[master]

Slide 32

Slide 32 text

[master]

Slide 33

Slide 33 text

[master] [branch]

Slide 34

Slide 34 text

[master] [branch]

Slide 35

Slide 35 text

[master] [branch] merge

Slide 36

Slide 36 text

BRANCHES ARE CHEAP

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

$cd MyAwesomeApp

Slide 39

Slide 39 text

$cd MyAwesomeApp $git branch newFeature

Slide 40

Slide 40 text

$cd MyAwesomeApp $git checkout newFeature $git branch newFeature Switched to branch ‘newFeature’

Slide 41

Slide 41 text

$cd MyAwesomeApp $git checkout newFeature $git branch newFeature Switched to branch ‘newFeature’

Slide 42

Slide 42 text

$cd MyAwesomeApp $git checkout newFeature $git add . $git branch newFeature Switched to branch ‘newFeature’

Slide 43

Slide 43 text

$cd MyAwesomeApp $git checkout newFeature $git add . $git status # On branch newFeature # Changes to be committed: # (use "git reset HEAD ..." to unstage) # #! modified: index.html # $git branch newFeature Switched to branch ‘newFeature’

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

$git commit -m “Best feature ever” [newFeature 18q7d58] Best feature ever 1 file changed, 1 insertions(+)

Slide 46

Slide 46 text

$git commit -m “Best feature ever” $git checkout master [newFeature 18q7d58] Best feature ever 1 file changed, 1 insertions(+) Switched to branch ‘master’

Slide 47

Slide 47 text

$git commit -m “Best feature ever” $git checkout master [newFeature 18q7d58] Best feature ever 1 file changed, 1 insertions(+) $git merge newFeature Switched to branch ‘master’ Updating 7ce2952..18q7d58 index.html | 1 + 1 file changed, 1 insertion(+)

Slide 48

Slide 48 text

BUT YOU CHANGED THE FILE

Slide 49

Slide 49 text

WORKFLOWS

Slide 50

Slide 50 text

LOCAL

Slide 51

Slide 51 text

LOCAL REMOTE

Slide 52

Slide 52 text

LOCAL LOCAL

Slide 53

Slide 53 text

LOCAL REMOTE LOCAL

Slide 54

Slide 54 text

LOCAL LOCAL REMOTE WEB SERVER

Slide 55

Slide 55 text

LOCAL LOCAL REMOTE WEB SERVER

Slide 56

Slide 56 text

HOW WE DO IT @ GVSU

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

GITHUB

Slide 60

Slide 60 text

GITHUB WEB SERVER

Slide 61

Slide 61 text

MASTER IS ALWAYS DEPLOYABLE

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Slide 64

Slide 64 text

$ssh [email protected] $git mkdir MyAwesomeApp

Slide 65

Slide 65 text

$ssh [email protected] $git cd MyAwesomeApp $git mkdir MyAwesomeApp

Slide 66

Slide 66 text

$ssh [email protected] $git cd MyAwesomeApp remote: Counting objects: 1, done. remote: Compressing objects: 100% (1/1), done. remote: Total 1 (delta 21), reused 1 (delta 14) Unpacking objects: 100% (1/1), done. $git mkdir MyAwesomeApp $git clone https://github.com/gvsulib/ awesomeapp.git Cloning into awesomeapp...

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

Slide 69

Slide 69 text

$ssh [email protected] $git cd MyAwesomeApp

Slide 70

Slide 70 text

$ssh [email protected] $git cd MyAwesomeApp $git pull origin master

Slide 71

Slide 71 text

BUT

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

https://gist.github.com/3138516

Slide 75

Slide 75 text

OTHER FANCY FEATURES

Slide 76

Slide 76 text

.gitignore

Slide 77

Slide 77 text

diff

Slide 78

Slide 78 text

log

Slide 79

Slide 79 text

filter-branch

Slide 80

Slide 80 text

stash

Slide 81

Slide 81 text

reset

Slide 82

Slide 82 text

RESOURCES John Fink: A Gentle Introduction to Modern Version Control http://acrl.ala.org/techconnect/?p=1191 Flashbake - automated git for writers http:/bitbucketlabs.net/flashbake Download git http://git-scm.com Git Reference http://gitref.org Git and Github Bootcamp http://help.github.com/articles/set-up-git

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

THANK YOU [email protected] @mreidsma http://github.com/mreidsma http://github.com/gvsulib