git going for the transylvania jug

81
Introduction to Git at the Transylvania JUG by Matthew McCullough

Upload: matthew-mccullough

Post on 12-Apr-2017

253 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Git Going for the Transylvania JUG

Introduction to Git

at the Transylvania JUG

by Matthew McCullough

Page 2: Git Going for the Transylvania JUG

Matthew McCullough

@matthewmccull

Page 3: Git Going for the Transylvania JUG
Page 4: Git Going for the Transylvania JUG

Git

Page 5: Git Going for the Transylvania JUG

“Cool kids” version control system

Page 6: Git Going for the Transylvania JUG

Open Source

Page 7: Git Going for the Transylvania JUG

bash scripts ☛ C code

Page 8: Git Going for the Transylvania JUG

Page 9: Git Going for the Transylvania JUG
Page 10: Git Going for the Transylvania JUG

Git-nounBritish Slang. an unpleasant

or contemptible person

-Oxford English Dictionary

Page 11: Git Going for the Transylvania JUG
Page 13: Git Going for the Transylvania JUG

➡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

Page 14: Git Going for the Transylvania JUG

➡How to set up a Git repository

Page 15: Git Going for the Transylvania JUG
Page 16: Git Going for the Transylvania JUG

> cd myproj> git initInitialized empty Git repository in /stuff/myproj/.git/

Page 17: Git Going for the Transylvania JUG

➡How to set up a Git repository

Page 18: Git Going for the Transylvania JUG
Page 19: Git Going for the Transylvania JUG

➡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

Page 20: Git Going for the Transylvania JUG

➡How to commit, branch and tag

Page 21: Git Going for the Transylvania JUG
Page 22: Git Going for the Transylvania JUG

➡How to commit

Page 23: Git Going for the Transylvania JUG

> git add <FILENAME>

Page 24: Git Going for the Transylvania JUG

Local Branches

Remote Branches

Upstream Branches

Working Copy

commit

Page 25: Git Going for the Transylvania JUG

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

Page 26: Git Going for the Transylvania JUG

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

Page 27: Git Going for the Transylvania JUG

➡How to branch

Page 28: Git Going for the Transylvania JUG

> git branch <BRANCHNAME>

Page 29: Git Going for the Transylvania JUG

Local Branches

Remote Branches

Upstream Branches

Working Copy

Branches

Page 30: Git Going for the Transylvania JUG

> git checkout <BRANCHNAME>Switched to branch 'mybranch'

Page 31: Git Going for the Transylvania JUG

Local Branches

Remote Branches

Upstream Branches

Working Copy

Branches

Page 32: Git Going for the Transylvania JUG

Insane branch count?

Page 33: Git Going for the Transylvania JUG

Local Remote Upstream

Integ

Product

Integ

Product

Integ

Product

Page 34: Git Going for the Transylvania JUG

Local Remote Upstream

Integ

Product

Integ

Product

Integ

Product

Idea

Story

Feature FeatureFeature

Page 35: Git Going for the Transylvania JUG

Local Remote Upstream

Integ

Product

Integ

Product

Integ

Product

Idea

Story

Feature FeatureFeature

Page 36: Git Going for the Transylvania JUG

➡How to tag

Page 37: Git Going for the Transylvania JUG

> git tag <TAGNAME>

Page 38: Git Going for the Transylvania JUG

> git tag -a <TAGNAME> -m”<MESSAGE>”

Page 39: Git Going for the Transylvania JUG

➡How to commit, branch and tag

Page 40: Git Going for the Transylvania JUG
Page 41: Git Going for the Transylvania JUG

➡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

Page 42: Git Going for the Transylvania JUG

➡How Git implements a new commit-referencing syntax

Page 43: Git Going for the Transylvania JUG
Page 44: Git Going for the Transylvania JUG

9AB223D28B1AA46EF1780B22F304982E39872C34

<html><body>

<p>This is a test</p><img src="http://ai.com/icon.gif">

</body></html>

Page 45: Git Going for the Transylvania JUG

> git logcommit 0fc27c73dea82a0576c6cf262fb517d24e75a223Author: Matthew McCullough <[email protected]>Date: Mon Oct 24 10:42:20 2013 +0300

Performance enhancement of calc engine

commit 7d946e814233814b1780ed1035da271cbb37206dAuthor: Matthew McCullough <[email protected]>Date: Mon Oct 24 12:59:41 2013 +0300

Translation to Esperanto

Page 46: Git Going for the Transylvania JUG

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 47: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 48: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 49: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 50: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 51: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 52: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 53: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 54: Git Going for the Transylvania JUG

Hashes

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

Page 55: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 56: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 57: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 58: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 59: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 60: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 61: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 62: Git Going for the Transylvania JUG

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

Page 63: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 64: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 65: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 66: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 67: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 68: Git Going for the Transylvania JUG

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Page 69: Git Going for the Transylvania JUG

➡How Git implements a new commit-referencing syntax

Page 70: Git Going for the Transylvania JUG
Page 71: Git Going for the Transylvania JUG

➡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

Page 72: Git Going for the Transylvania JUG

➡How to pull and push changes between repositories

Page 73: Git Going for the Transylvania JUG
Page 74: Git Going for the Transylvania JUG

> git clone http://this.com/myproj.git> cd myprojCloning 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.

Page 75: Git Going for the Transylvania JUG

Local Branches

Remote Branches

Upstream Branches

Working Copy

merge merge

commit

fetch

push

clone clone clone

push

pull pull pull

Page 76: Git Going for the Transylvania JUG

Central Repo

Ce

nt

ra

liz

ed

Page 77: Git Going for the Transylvania JUG

Blessed Repo

Dic

ta

to

rs

hip

Page 78: Git Going for the Transylvania JUG

Certified Repo

Development Repo

Int

eg

ra

tio

n M

an

ag

ed

ContinuousIntegration

Server

Page 79: Git Going for the Transylvania JUG

➡How to pull and push changes between repositories

Page 80: Git Going for the Transylvania JUG
Page 81: Git Going for the Transylvania JUG

Introduction to Git & Gerrit

at the Transylvania JUG

by Matthew McCullough