Slide 1

Slide 1 text

A collaborative reboot for version control GIT FOR THE UNINITIATED

Slide 2

Slide 2 text

Matthew.... @matthewmccull ‣Open source contributor ‣O'Reilly Git Video Co-instructor ‣Co-Author of O'Reilly's Git book ‣5-year Git trainer ‣Instructor at GitHub

Slide 3

Slide 3 text

http://oreil.ly/ogitvid

Slide 4

Slide 4 text

http://amzn.to/oreillygit

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Version Control A refreshed approach to VCS

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Open Source

Slide 12

Slide 12 text

bash scripts ☛ C code

Slide 13

Slide 13 text

is not a slightly better

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

http://git-scm.com

Slide 18

Slide 18 text

Starting Up Creating a repository

Slide 19

Slide 19 text

Get a GitHub account.

Slide 20

Slide 20 text

Get a GitHub account. http://github.com/signup/free

Slide 21

Slide 21 text

Create a new repo(sitory).

Slide 22

Slide 22 text

Add a file.

Slide 23

Slide 23 text

View the commit history (timeline).

Slide 24

Slide 24 text

Make changes to the file.

Slide 25

Slide 25 text

Repo Creation Local and remote initialization simplicity

Slide 26

Slide 26 text

# Green field project $ git init newproject $ cd newproject # ...start coding

Slide 27

Slide 27 text

or if you already have source code

Slide 28

Slide 28 text

# Legacy project tree $ cd existingproject $ git init # Add all the code $ git add . $ git commit -m”Initial import”

Slide 29

Slide 29 text

‣Blob ‣Tree ‣Commit ‣Tag

Slide 30

Slide 30 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 31

Slide 31 text

Collaborating Two authors

Slide 32

Slide 32 text

Make simultaneous changes to the file.

Slide 33

Slide 33 text

Collaborating Redux Untrusted collaborators

Slide 34

Slide 34 text

Untrusted changes to the file.

Slide 35

Slide 35 text

Changelist Three stage thinking

Slide 36

Slide 36 text

Working Staging Repo add commit edit

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

‣shopping cart ‣put things in ‣take things out ‣purchase at register

Slide 39

Slide 39 text

v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File B File B File A File A File C File C File C

Slide 40

Slide 40 text

Workspaces The power of simple branch toggling

Slide 41

Slide 41 text

Local Remote Upstream

Slide 42

Slide 42 text

# Creating a branch git branch

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

What do cheap branches enable?

Slide 45

Slide 45 text

‣Experimentation ‣

Slide 46

Slide 46 text

‣Experimentation ‣Safe experimentation

Slide 47

Slide 47 text

Better reuse of units of work

Slide 48

Slide 48 text

Work Models Enabling different development styles

Slide 49

Slide 49 text

product v1.0 integration story1 story2 v1.5 integration story3

Slide 50

Slide 50 text

Local Remote Upstream Integ Product Integ Product Integ Product

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

C u s t o m + P u b l i c C o n t r i b Customized ☚ Private Public ☛ GitHub

Slide 57

Slide 57 text

Mirror Development Repo M i r r o r e d Mirror Certified Repo

Slide 58

Slide 58 text

Client Apps GUIs and other front-ends

Slide 59

Slide 59 text

http://windows.github.com

Slide 60

Slide 60 text

http://windows.github.com

Slide 61

Slide 61 text

http://mac.github.com

Slide 62

Slide 62 text

http://mac.github.com

Slide 63

Slide 63 text

Remotes Bandwidth and geographic challenges

Slide 64

Slide 64 text

Local Remote Upstream

Slide 65

Slide 65 text

Local Remote Upstream

Slide 66

Slide 66 text

Local Remote Upstream

Slide 67

Slide 67 text

data from http://whygitisbetterthanx.com/#git-is-fast git svn Init git svn Status git svn Diff git svn Tag git svn Log git svn Commit (Lg) git svn Commit (Sm) git c svn c Branch Speed

Slide 68

Slide 68 text

Local Remote Upstream commit fetch push clone clone clone push pull pull pull

Slide 69

Slide 69 text

Commit Push Pull

Slide 70

Slide 70 text

Commit Push Pull

Slide 71

Slide 71 text

Commit Push Pull

Slide 72

Slide 72 text

Integration CI, scripting, and hooks

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

"This is so important, we can't entrust it to automation. We need our top developer to supervise it."

Slide 75

Slide 75 text

continuous integration servers jenkins travis ci circleci buildhive

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

Summary The Git and GitHub ecosystem

Slide 82

Slide 82 text

[email protected] github.com/training @githubtraining githubtraining Q&A

Slide 83

Slide 83 text

http://learn.github.com

Slide 84

Slide 84 text

http://teach.github.com

Slide 85

Slide 85 text

Why Git?

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git. -Linus Torvalds “ Credits: Martin Streicher, http://en.wikipedia.org/wiki/File:Linus_Torvalds.jpeg

Slide 89

Slide 89 text

CVS Subversion PVCS Perforce Clear Case Source Safe RCS Folders

Slide 90

Slide 90 text

Small Footprint

Slide 91

Slide 91 text

Simple

Slide 92

Slide 92 text

Powerful

Slide 93

Slide 93 text

Composable

Slide 94

Slide 94 text

Setting Up Git

Slide 95

Slide 95 text

binaries on your $PATH

Slide 96

Slide 96 text

http://help.github.com

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

Using Git

Slide 99

Slide 99 text

Create a Git repository

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

http://git-scm.com/book

Slide 102

Slide 102 text

http://teach.github.com

Slide 103

Slide 103 text

http://help.github.com

Slide 104

Slide 104 text

Git GUIs

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

https://github.com/github/GitPad

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

http://eclipse.org/egit/

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

Using GitHub

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

‣Social coding ‣Fork and pull model

Slide 113

Slide 113 text

Blessed Repo

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

‣Web-based image diff ‣Lightweight issue tracking

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

https://enterprise.github.com

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

Q&A

Slide 121

Slide 121 text

@matthewmccull [email protected] training.github.com