Slide 1

Slide 1 text

Git the Git Workshop learn

Slide 2

Slide 2 text

speakerdeck.com/anotheruiguy/ git-for-everyone

Slide 3

Slide 3 text

gitbook.io/book/anotheruiguy/ gitforeveryone

Slide 4

Slide 4 text

That’s me! That’s where ! I ‘work’ @ANOTHERUIGUY That’s a ninja

Slide 5

Slide 5 text

why so hard?

Slide 6

Slide 6 text

How can I get to that file?

Slide 7

Slide 7 text

How can I get to that file? Just open Terminal and then $ cd ~/Projects/ boilerplate/ && vi .gitignore

Slide 8

Slide 8 text

How can I get to that file? Just open Terminal and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do?

Slide 9

Slide 9 text

How can I get to that file? Just open Terminal and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do? Geeze, press the i key, go to this line and add <file path>/**/*. Then hit the esc key to save. To get out, type :wq, ok!?

Slide 10

Slide 10 text

How can I get to that file? Just open Terminal and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do? Geeze, press the i key, go to this line and add <file path>/**/*. Then hit the esc key to save. To get out, type :wq, ok!?

Slide 11

Slide 11 text

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Terminal Cheatsheet for Mac

Slide 14

Slide 14 text

Open files in VI $ touch index.html

Slide 15

Slide 15 text

Open files in VI $ touch index.html $ vi index.html

Slide 16

Slide 16 text

Open files in VI $ touch index.html $ vi index.html i

Slide 17

Slide 17 text

Open files in VI $ touch index.html $ vi index.html i esc + :wq

Slide 18

Slide 18 text

Open files in VI $ touch index.html $ vi index.html i esc + :wq

Slide 19

Slide 19 text

what?

Slide 20

Slide 20 text

Before VC or Branching my-project-folder YAY! My project!

Slide 21

Slide 21 text

Before VC or Branching my-project-folder I need to update my project

Slide 22

Slide 22 text

Before VC or Branching my-project-folder I need to update my project my-project-folder-copy

Slide 23

Slide 23 text

Before VC or Branching my-project-folder my-project-folder-copy Yup, need another version

Slide 24

Slide 24 text

Before VC or Branching my-project-folder my-project-folder-copy Yup, need another version my-project-folder-copy-v2

Slide 25

Slide 25 text

Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert some code ;(

Slide 26

Slide 26 text

Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert some code ;( Crap! Which folder has the right stuff?

Slide 27

Slide 27 text

Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then …

Slide 28

Slide 28 text

Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then … NOTHING IS WORKING!!

Slide 29

Slide 29 text

Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then … NOTHING IS WORKING!! Boss: Hey, we have a new person you will work with. You need to share code and work on solving problems together. ! ! You: SHIT! Dropbox, why you no scale?

Slide 30

Slide 30 text

Inexpensive versioning master

Slide 31

Slide 31 text

Inexpensive versioning master

Slide 32

Slide 32 text

Inexpensive versioning master feature-branch

Slide 33

Slide 33 text

Inexpensive versioning master feature-branch

Slide 34

Slide 34 text

Inexpensive versioning master feature-branch feature-branch

Slide 35

Slide 35 text

Inexpensive versioning master feature-branch feature-branch

Slide 36

Slide 36 text

Inexpensive versioning master feature-branch feature-branch

Slide 37

Slide 37 text

Inexpensive versioning master feature-branch feature-branch

Slide 38

Slide 38 text

Forking and Cloning

Slide 39

Slide 39 text

Forking and Cloning $ git clone [email protected]:blackfalcon/label-reveal.git

Slide 40

Slide 40 text

Forking and Cloning Source

Slide 41

Slide 41 text

Forking and Cloning Source Your fork

Slide 42

Slide 42 text

Forking and Cloning Source Your fork feature-branch feature-branch

Slide 43

Slide 43 text

Forking and Cloning Source Your fork feature-branch feature-branch

Slide 44

Slide 44 text

Forking and Cloning Source Your fork feature-branch feature-branch The Pull Request

Slide 45

Slide 45 text

branching and merging

Slide 46

Slide 46 text

$ git branch

Slide 47

Slide 47 text

$ git branch $ git checkout master

Slide 48

Slide 48 text

$ git branch $ git checkout master $ git pull origin master

Slide 49

Slide 49 text

$ git branch $ git checkout master $ git pull origin master $ git checkout -b my-new-feature-branch

Slide 50

Slide 50 text

$ git branch $ git checkout master $ git pull origin master $ git checkout -b my-new-feature-branch $ git checkout -b transaction-fail-message master

Slide 51

Slide 51 text

$ git status

Slide 52

Slide 52 text

$ git status $ git add .

Slide 53

Slide 53 text

$ git status $ git add . $ git add -u

Slide 54

Slide 54 text

$ git status $ git add . $ git add -u $ git add --all

Slide 55

Slide 55 text

$ git status $ git add . $ git add -u $ git add --all $ git commit -m "a commit message in the present tense"

Slide 56

Slide 56 text

$ git commit -m "fixed bug with login feature"

Slide 57

Slide 57 text

$ git commit -m "fixed bug with login feature"

Slide 58

Slide 58 text

$ git commit -m "fixed bug with login feature" $ git commit -m "update app config to address login bug"

Slide 59

Slide 59 text

$ git branch -r << this will list remote branches

Slide 60

Slide 60 text

$ git branch -r << this will list remote branches $ git fetch -p << this will prune your local index

Slide 61

Slide 61 text

$ git branch -r << this will list remote branches $ git fetch -p << this will prune your local index $ git checkout new-remote-feature-branch

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

$ git checkout my-feature-branch

Slide 64

Slide 64 text

$ git checkout my-feature-branch $ git pull origin my-feature-branch

Slide 65

Slide 65 text

$ git checkout my-feature-branch $ git pull origin my-feature-branch $ git pull origin master

Slide 66

Slide 66 text

$ git checkout master

Slide 67

Slide 67 text

$ git checkout master $ git pull origin master

Slide 68

Slide 68 text

$ git checkout master $ git pull origin master $ git merge --no-ff my-feature-branch

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

$ cd ~/Desktop

Slide 72

Slide 72 text

$ cd ~/Desktop $ mkdir gitDemo

Slide 73

Slide 73 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status

Slide 74

Slide 74 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status $ git init

Slide 75

Slide 75 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status $ git init $ git status

Slide 76

Slide 76 text

$ touch index.html

Slide 77

Slide 77 text

$ touch index.html $ mkdir stylesheets

Slide 78

Slide 78 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts

Slide 79

Slide 79 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts $ cd stylesheets && touch app.css && cd ../

Slide 80

Slide 80 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts $ cd stylesheets && touch app.css && cd ../ $ cd javascripts && touch app.js && cd ../

Slide 81

Slide 81 text

$ mkdir foo

Slide 82

Slide 82 text

$ mkdir foo $ git status

Slide 83

Slide 83 text

$ mkdir foo $ git status $ rm -rf foo

Slide 84

Slide 84 text

Hello World

Slide 85

Slide 85 text

Hello World

h1 { font-size: 8em; }

Slide 86

Slide 86 text

Hello World

h1 { font-size: 8em; } var today = new Date()

Slide 87

Slide 87 text

$ git add .

Slide 88

Slide 88 text

$ git add . $ git status

Slide 89

Slide 89 text

$ git add . $ git status $ git commit -m "update to function ..."

Slide 90

Slide 90 text

$ git add . $ git status $ git commit -m "update to function ..." $ git status

Slide 91

Slide 91 text

$ git add . $ git status $ git commit -m "update to function ..." $ git status # On branch master nothing to commit …

Slide 92

Slide 92 text

$ git log

Slide 93

Slide 93 text

$ git log $ git blame index.html

Slide 94

Slide 94 text

$ git log $ git blame index.html ^15d42d5 (Dale Sande 2014-06-10 18:25:26 -0700 1)

Slide 95

Slide 95 text

$ git branch

Slide 96

Slide 96 text

$ git branch $ git checkout -b new-branch

Slide 97

Slide 97 text

$ git branch $ git checkout -b new-branch

goodnight moon

Slide 98

Slide 98 text

$ git branch $ git checkout -b new-branch

goodnight moon

p { font-size: 2em; }

Slide 99

Slide 99 text

$ git branch $ git checkout -b new-branch

goodnight moon

p { font-size: 2em; } $ git status

Slide 100

Slide 100 text

$ git add .

Slide 101

Slide 101 text

$ git add . $ git commit -m "update content and styles"

Slide 102

Slide 102 text

$ git add . $ git commit -m "update content and styles" $ git checkout master

Slide 103

Slide 103 text

$ git checkout master

Slide 104

Slide 104 text

$ git checkout master $ git branch --merged

Slide 105

Slide 105 text

$ git checkout master $ git branch --merged $ git branch --no-merged

Slide 106

Slide 106 text

$ git merge new-branch --no-ff

Slide 107

Slide 107 text

$ git merge new-branch --no-ff :wq

Slide 108

Slide 108 text

$ git merge new-branch --no-ff :wq $ git branch --merged

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

fork all the codes

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

clone all the codes

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

you Git awesome!

Slide 117

Slide 117 text

$ which git If a version of Git is not there! …

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

$ brew install git this is pretty metal

Slide 120

Slide 120 text

$ brew install git this is pretty metal PATH=/usr/local/bin:$PATH That goes in your ~/.bash_profile bro!

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

$ cd ~/Desktop

Slide 123

Slide 123 text

$ cd ~/Desktop $ mkdir gitDemo

Slide 124

Slide 124 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status

Slide 125

Slide 125 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status $ git init

Slide 126

Slide 126 text

$ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo && git status $ git init $ git status

Slide 127

Slide 127 text

$ touch index.html

Slide 128

Slide 128 text

$ touch index.html $ mkdir stylesheets

Slide 129

Slide 129 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts

Slide 130

Slide 130 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts $ cd stylesheets && touch app.css && cd ../

Slide 131

Slide 131 text

$ touch index.html $ mkdir stylesheets $ mkdir javascripts $ cd stylesheets && touch app.css && cd ../ $ cd javascripts && touch app.js && cd ../

Slide 132

Slide 132 text

$ mkdir foo

Slide 133

Slide 133 text

$ mkdir foo $ git status

Slide 134

Slide 134 text

$ mkdir foo $ git status $ rm -rf foo

Slide 135

Slide 135 text

Hello World

That goes in your index.html

Slide 136

Slide 136 text

Hello World

That goes in your index.html h1 { font-size: 8em; } That goes in your app.css

Slide 137

Slide 137 text

Hello World

That goes in your index.html h1 { font-size: 8em; } That goes in your app.css var today = new Date() That goes in your app.js

Slide 138

Slide 138 text

$ git add .

Slide 139

Slide 139 text

$ git add . $ git status

Slide 140

Slide 140 text

$ git add . $ git status $ git commit -m "update to function ..."

Slide 141

Slide 141 text

$ git add . $ git status $ git commit -m "update to function ..." $ git status

Slide 142

Slide 142 text

$ git add . $ git status $ git commit -m "update to function ..." $ git status # On branch master nothing to commit …

Slide 143

Slide 143 text

$ git log

Slide 144

Slide 144 text

$ git log $ git blame index.html

Slide 145

Slide 145 text

$ git log $ git blame index.html ^15d42d5 (Dale Sande 2014-06-10 18:25:26 -0700 1)

Slide 146

Slide 146 text

$ git branch

Slide 147

Slide 147 text

$ git branch $ git checkout -b new-branch

Slide 148

Slide 148 text

$ git branch $ git checkout -b new-branch

goodnight moon

Slide 149

Slide 149 text

$ git branch $ git checkout -b new-branch

goodnight moon

p { font-size: 2em; }

Slide 150

Slide 150 text

$ git branch $ git checkout -b new-branch

goodnight moon

p { font-size: 2em; } $ git status

Slide 151

Slide 151 text

$ git add .

Slide 152

Slide 152 text

$ git add . $ git commit -m "update content and styles"

Slide 153

Slide 153 text

$ git add . $ git commit -m "update content and styles" $ git checkout master

Slide 154

Slide 154 text

$ git checkout master

Slide 155

Slide 155 text

$ git checkout master $ git branch --merged

Slide 156

Slide 156 text

$ git checkout master $ git branch --merged $ git branch --no-merged

Slide 157

Slide 157 text

$ git merge new-branch --no-ff

Slide 158

Slide 158 text

$ git merge new-branch --no-ff :wq

Slide 159

Slide 159 text

$ git merge new-branch --no-ff :wq $ git branch --merged

Slide 160

Slide 160 text

$ git log --abbrev-commit --graph"

Slide 161

Slide 161 text

No content

Slide 162

Slide 162 text

No content

Slide 163

Slide 163 text

No content

Slide 164

Slide 164 text

come Git more!

Slide 165

Slide 165 text

Thanks!