Slide 1

Slide 1 text

Introduction to Git at the Transylvania JUG by Matthew McCullough

Slide 2

Slide 2 text

Matthew McCullough @matthewmccull

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Git

Slide 5

Slide 5 text

“Cool kids” version control system

Slide 6

Slide 6 text

Open Source

Slide 7

Slide 7 text

bash scripts ☛ C code

Slide 8

Slide 8 text

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Git -noun British Slang. an unpleasant or contemptible person -Oxford English Dictionary “ ”

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git. -Linus Torvalds “ ”

Slide 13

Slide 13 text

➡How to commit, branch and tag ➡How Git implements a new commit-referencing syntax ➡How to pull and push changes between repositories ➡How to set up a Git repository

Slide 14

Slide 14 text

➡How to set up a Git repository

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

> cd myproj > git init Initialized empty Git repository in /stuff/myproj/.git/

Slide 17

Slide 17 text

➡How to set up a Git repository

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

➡How to commit, branch and tag ➡How Git implements a new commit-referencing syntax ➡How to pull and push changes between repositories ➡How to set up a Git repository

Slide 20

Slide 20 text

➡How to commit, branch and tag

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

➡How to commit

Slide 23

Slide 23 text

> git add

Slide 24

Slide 24 text

Local Branches Remote Branches Upstream Branches Working Copy commit

Slide 25

Slide 25 text

> git status # On branch master # Initial commit # Changes to be committed: # (use "git rm --cached ..." to unstage) # new file: myfile.txt

Slide 26

Slide 26 text

> git commit -m”” [master (root-commit) 498cc44] My first commit 1 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 myfile.txt

Slide 27

Slide 27 text

➡How to branch

Slide 28

Slide 28 text

> git branch

Slide 29

Slide 29 text

Local Branches Remote Branches Upstream Branches Working Copy Branches

Slide 30

Slide 30 text

> git checkout Switched to branch 'mybranch'

Slide 31

Slide 31 text

Local Branches Remote Branches Upstream Branches Working Copy Branches

Slide 32

Slide 32 text

Insane branch count?

Slide 33

Slide 33 text

Local Remote Upstream Integ Product Integ Product Integ Product

Slide 34

Slide 34 text

Local Remote Upstream Integ Product Integ Product Integ Product Idea Story Feature Feature Feature

Slide 35

Slide 35 text

Local Remote Upstream Integ Product Integ Product Integ Product Idea Story Feature Feature Feature

Slide 36

Slide 36 text

➡How to tag

Slide 37

Slide 37 text

> git tag

Slide 38

Slide 38 text

> git tag -a -m””

Slide 39

Slide 39 text

➡How to commit, branch and tag

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

➡How to commit, branch and tag ➡How Git implements a new commit-referencing syntax ➡How to pull and push changes between repositories ➡How to set up a Git repository

Slide 42

Slide 42 text

➡How Git implements a new commit-referencing syntax

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

9AB223D28B1AA46EF1780B22F304982E39872C34

This is a test

Slide 45

Slide 45 text

> git log commit 0fc27c73dea82a0576c6cf262fb517d24e75a223 Author: Matthew McCullough Date: Mon Oct 24 10:42:20 2013 +0300 Performance enhancement of calc engine commit 7d946e814233814b1780ed1035da271cbb37206d Author: Matthew McCullough Date: Mon Oct 24 12:59:41 2013 +0300 Translation to Esperanto

Slide 46

Slide 46 text

tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 47

Slide 47 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 48

Slide 48 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 49

Slide 49 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 50

Slide 50 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 51

Slide 51 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 52

Slide 52 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 53

Slide 53 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 54

Slide 54 text

Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 55

Slide 55 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 56

Slide 56 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 57

Slide 57 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 58

Slide 58 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 59

Slide 59 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 60

Slide 60 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 61

Slide 61 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 62

Slide 62 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 63

Slide 63 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 64

Slide 64 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 65

Slide 65 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 66

Slide 66 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 67

Slide 67 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 68

Slide 68 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 69

Slide 69 text

➡How Git implements a new commit-referencing syntax

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

➡How to commit, branch and tag ➡How Git implements a new commit-referencing syntax ➡How to pull and push changes between repositories ➡How to set up a Git repository

Slide 72

Slide 72 text

➡How to pull and push changes between repositories

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

> git clone http://this.com/myproj.git > cd myproj Cloning into hellogitworld... remote: Counting objects: 3871, done. remote: Compressing objects: 100% (73/73), done. remote: Total 3871 (delta 51), reused 3853 (delta 36) Receiving objects: 100% (3871/3871), 297.88 KiB | 35 KiB/s, done. Resolving deltas: 100% (51/51), done.

Slide 75

Slide 75 text

Local Branches Remote Branches Upstream Branches Working Copy merge merge commit fetch push clone clone clone push pull pull pull

Slide 76

Slide 76 text

Central Repo C e n t r a l i z e d

Slide 77

Slide 77 text

Blessed Repo D i c t a t o r s h i p

Slide 78

Slide 78 text

Certified Repo Development Repo I n t e g r a t i o n M a n a g e d Continuous Integration Server

Slide 79

Slide 79 text

➡How to pull and push changes between repositories

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

Introduction to Git & Gerrit at the Transylvania JUG by Matthew McCullough