Slide 1

Slide 1 text

Switching to Why & How

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

! ben " benstraub

Slide 4

Slide 4 text

No content

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

h p://redmonk.com/sogrady/2013/12/19/dvcs-and-git-2013/ CVS -16% SVN -13% git +30%

Slide 9

Slide 9 text

Why & How

Slide 10

Slide 10 text

SCCS Local Files Only

Slide 11

Slide 11 text

CVS …But With Network

Slide 12

Slide 12 text

SVN …But With Branching

Slide 13

Slide 13 text

No content

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

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

git WHOA

Slide 30

Slide 30 text

Workflow

Slide 31

Slide 31 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 32

Slide 32 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 33

Slide 33 text

r7 | ben | 2014-01-15 19:04:14 -08 ! stuff

Slide 34

Slide 34 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 35

Slide 35 text

# file1 blah blah blah work for feature A blah blah # file2 blah blah blah blah blah work for feature A

Slide 36

Slide 36 text

# file1 blah blah blah work for feature A blah blah # file2 blah blah blah blah blah work for feature A

Slide 37

Slide 37 text

# file1 blah blah blah work for feature A blah blah wrok for feture B # file2 blah blah blah mayk feetchur B blah blah work for feature A

Slide 38

Slide 38 text

# file1 blah blah blah work for feature A blah / fix #7 blah wrok for feture B # file2 blah blah / fix #2 blah mayk feetchur B blah blah work for feature A

Slide 39

Slide 39 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 40

Slide 40 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 41

Slide 41 text

# file1 blah blah blah work for feature A blah blah work for feature B # file2 blah blah blah work for feature B blah blah work for feature A

Slide 42

Slide 42 text

Mindflow

Slide 43

Slide 43 text

clone/checkout svn: 5.3s git: 14.5s Size on disk svn: 5.5 MB git: 21 MB JQuery

Slide 44

Slide 44 text

log (10 entries) svn: 1.2s git: 0.008s show svn: 6.2s git: .009s 150x faster 689x faster commit svn: 44s git: 0.2s 220x faster

Slide 45

Slide 45 text

Shared Repository Developer Developer Developer

Slide 46

Slide 46 text

Shared Repository Developer Developer Developer X

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Shared Repository Developer Developer Developer X

Slide 49

Slide 49 text

Shared Repository Developer Developer Developer X Temp Repository

Slide 50

Slide 50 text

Shared Repository Developer Developer Developer X Temp Repository

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

Capability

Slide 53

Slide 53 text

But… What will I miss?

Slide 54

Slide 54 text

Why & How

Slide 55

Slide 55 text

Why & How

Slide 56

Slide 56 text

1. Migrate Your Data

Slide 57

Slide 57 text

SVN !/nirvdrum/svn2git

Slide 58

Slide 58 text

Authors File cvorca ben l33rj3t17 bob johnnyappleseed employee27451

Slide 59

Slide 59 text

Authors File cvorca ben l33rj3t17 bob johnnyappleseed employee27451 cvorca

Slide 60

Slide 60 text

Authors File cvorca ben l33rj3t17 bob johnnyappleseed employee27451 Joan Cleaver Ben Kingsley Steven Spielberg Johnny Depp

Slide 61

Slide 61 text

TFS h p://git-tfs.com/

Slide 62

Slide 62 text

Perforce git-p4

Slide 63

Slide 63 text

Others h p://www.lmgtfy.com/?q=migrate +to+git+from+

Slide 64

Slide 64 text

Others git fast-import

Slide 65

Slide 65 text

2. Put It Somewhere Safe

Slide 66

Slide 66 text

#

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

3. Get To Work

Slide 69

Slide 69 text

Install Git h p://git-scm.com

Slide 70

Slide 70 text

GitHub Windows

Slide 71

Slide 71 text

Introduce Yourself git config --global user.name “Tom Jones” git config --global user.email “[email protected]

Slide 72

Slide 72 text

›❯ mkdir newrepo; cd newrepo ›❯ git init Initialized empty Git repository in /tmp/newrepo/.git/ ›❯ ls -a . .. .git ›❯ Make a Repository

Slide 73

Slide 73 text

›❯ mkdir newrepo; cd newrepo ›❯ git init Initialized empty Git repository in /tmp/newrepo/.git/ ›❯ ls -a . .. .git ›❯ Make a Repository

Slide 74

Slide 74 text

›❯ mkdir newrepo; cd newrepo ›❯ git init Initialized empty Git repository in /tmp/newrepo/.git/ ›❯ ls -a . .. .git ›❯ Make a Repository

Slide 75

Slide 75 text

Clone a Repository ›❯ git clone https://github.com/jquery/jquery Cloning into 'jquery'... remote: Reusing existing pack: 32101, done. remote: Total 32101 (delta 0), reused 0 (delta 0) Receiving objects: 100% (32101/32101), 17.69 MiB | 1.04 MiB/ done. Resolving deltas: 100% (22737/22737), done. ›❯ cd jquery ›❯ ls -a . .gitignore .travis.yml bower.json .. .jscs.json AUTHORS.txt build .bowerrc .jshintignore CONTRIBUTING.md package.json

Slide 76

Slide 76 text

Clone a Repository ›❯ git clone https://github.com/jquery/jquery Cloning into 'jquery'... remote: Reusing existing pack: 32101, done. remote: Total 32101 (delta 0), reused 0 (delta 0) Receiving objects: 100% (32101/32101), 17.69 MiB | 1.04 MiB/ done. Resolving deltas: 100% (22737/22737), done. ›❯ cd jquery ›❯ ls -a . .gitignore .travis.yml bower.json .. .jscs.json AUTHORS.txt build .bowerrc .jshintignore CONTRIBUTING.md package.json

Slide 77

Slide 77 text

Clone a Repository ›❯ git clone https://github.com/jquery/jquery Cloning into 'jquery'... remote: Reusing existing pack: 32101, done. remote: Total 32101 (delta 0), reused 0 (delta 0) Receiving objects: 100% (32101/32101), 17.69 MiB | 1.04 MiB/ done. Resolving deltas: 100% (22737/22737), done. ›❯ cd jquery ›❯ ls -a . .gitignore .travis.yml bower.json .. .jscs.json AUTHORS.txt build .bowerrc .jshintignore CONTRIBUTING.md package.json

Slide 78

Slide 78 text

remote: Reusing existing pack: 32101, done. remote: Total 32101 (delta 0), reused 0 (delta 0) Receiving objects: 100% (32101/32101), 17.69 MiB | 1.04 MiB/ done. Resolving deltas: 100% (22737/22737), done. ›❯ cd jquery ›❯ ls -a . .gitignore .travis.yml bower.json .. .jscs.json AUTHORS.txt build .bowerrc .jshintignore CONTRIBUTING.md package.json .editorconfig .jshintrc Gruntfile.js speed .git .mailmap MIT-LICENSE.txt src .gitattributes .npmignore README.md test

Slide 79

Slide 79 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui &

Slide 80

Slide 80 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui &

Slide 81

Slide 81 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui &

Slide 82

Slide 82 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui &

Slide 83

Slide 83 text

Do Some Work

Slide 84

Slide 84 text

Do Some Work

Slide 85

Slide 85 text

Do Some Work

Slide 86

Slide 86 text

Do Some Work git add main.c

Slide 87

Slide 87 text

Do Some Work git commit

Slide 88

Slide 88 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui & ›❯ git log --oneline bd7b055 Add awesome new feature!!1!! 34c5978 Initial commit

Slide 89

Slide 89 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui & ›❯ git log --oneline bd7b055 Add awesome new feature!!1!! 34c5978 Initial commit

Slide 90

Slide 90 text

Do Some Work ›❯ git checkout -b new-feature Switched to a new branch 'new-feature' ›❯ echo “awesome stuff” >> main.c ›❯ git gui & ›❯ git log --oneline bd7b055 Add awesome new feature!!1!! 34c5978 Initial commit

Slide 91

Slide 91 text

Give To Others

Slide 92

Slide 92 text

Give To Others

Slide 93

Slide 93 text

Give To Others ›❯ git remote add origin https://github.com/mycorp/projec ›❯ git push -u origin new-feature Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 451 bytes, done. Total 6 (delta 1), reused 0 (delta 0) To https://github.com/mycorp/project.git * [new branch] new-feature -> new-feature ›❯ # more work

Slide 94

Slide 94 text

Give To Others ›❯ git remote add origin https://github.com/mycorp/projec ›❯ git push -u origin new-feature Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 451 bytes, done. Total 6 (delta 1), reused 0 (delta 0) To https://github.com/mycorp/project.git * [new branch] new-feature -> new-feature ›❯ # more work

Slide 95

Slide 95 text

›❯ git remote add origin https://github.com/mycorp/projec ›❯ git push -u origin new-feature Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 451 bytes, done. Total 6 (delta 1), reused 0 (delta 0) To https://github.com/mycorp/project.git * [new branch] new-feature -> new-feature ›❯ # more work ›❯ git push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 263 bytes, done.

Slide 96

Slide 96 text

›❯ git remote add origin https://github.com/mycorp/projec ›❯ git push -u origin new-feature Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 451 bytes, done. Total 6 (delta 1), reused 0 (delta 0) To https://github.com/mycorp/project.git * [new branch] new-feature -> new-feature ›❯ # more work ›❯ git push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 263 bytes, done.

Slide 97

Slide 97 text

Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 451 bytes, done. Total 6 (delta 1), reused 0 (delta 0) To https://github.com/mycorp/project.git * [new branch] new-feature -> new-feature ›❯ # more work ›❯ git push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 263 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To https://github.com/ben/temp.git bd7b055..0adf488 new-feature -> new-feature

Slide 98

Slide 98 text

Take From Others

Slide 99

Slide 99 text

Take From Others ›❯ git branch master * new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch

Slide 100

Slide 100 text

Take From Others ›❯ git branch master * new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch

Slide 101

Slide 101 text

Take From Others ›❯ git branch master * new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch

Slide 102

Slide 102 text

Take From Others ›❯ git branch master * new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0)

Slide 103

Slide 103 text

Take From Others ›❯ git branch master * new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0)

Slide 104

Slide 104 text

* new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://github.com/mycorp/project bd7b055..c88ae4b master -> origin/master ›❯ git merge origin/master -m 'Merging upstream work' Auto-merging main.c Merge made by the 'recursive' strategy. main.c | 1 +

Slide 105

Slide 105 text

* new-feature ›❯ git branch -a master * new-feature remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://github.com/mycorp/project bd7b055..c88ae4b master -> origin/master ›❯ git merge origin/master -m 'Merging upstream work' Auto-merging main.c Merge made by the 'recursive' strategy. main.c | 1 +

Slide 106

Slide 106 text

remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://github.com/mycorp/project bd7b055..c88ae4b master -> origin/master ›❯ git merge origin/master -m 'Merging upstream work' Auto-merging main.c Merge made by the 'recursive' strategy. main.c | 1 + 1 file changed, 1 insertion(+) ›❯ git push newrepo2/git/new-feature Counting objects: 7, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done.

Slide 107

Slide 107 text

remotes/origin/new-feature ›❯ git fetch remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://github.com/mycorp/project bd7b055..c88ae4b master -> origin/master ›❯ git merge origin/master -m 'Merging upstream work' Auto-merging main.c Merge made by the 'recursive' strategy. main.c | 1 + 1 file changed, 1 insertion(+) ›❯ git push newrepo2/git/new-feature Counting objects: 7, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done.

Slide 108

Slide 108 text

Auto-merging main.c Merge made by the 'recursive' strategy. main.c | 1 + 1 file changed, 1 insertion(+) ›❯ git push newrepo2/git/new-feature Counting objects: 7, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 305 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To /tmp/newrepo 0adf488..68f178c new-feature -> new-feature

Slide 109

Slide 109 text

commit merge merge fetch 4. Collaborate branch

Slide 110

Slide 110 text

5. Migrate Your Habits

Slide 111

Slide 111 text

“Branching is Hard.” – Mahatma Gandhi

Slide 112

Slide 112 text

“No, wait. Merging is Hard.” – Mahatma Gandhi

Slide 113

Slide 113 text

“I hate the command line.” – Stephen Harper

Slide 114

Slide 114 text

“Our repository is too big.” – Big Bird

Slide 115

Slide 115 text

“How do you lock files?” – Bruce Springsteen

Slide 116

Slide 116 text

“What about permissions?” – Luke Skywalker

Slide 117

Slide 117 text

$

Slide 118

Slide 118 text

Workflow Mindflow Capability Why & How Migrate Your Data Put it Somewhere Safe Migrate Your Habits

Slide 119

Slide 119 text

Switching to http://git.io/dGvy1w