Slide 1

Slide 1 text

git or: how I learned to stop worrying and love source control

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

why you should care

Slide 4

Slide 4 text

Traditional version control systems have deficiencies

Slide 5

Slide 5 text

Subversion, Perforce, CVS, TFS...

Slide 6

Slide 6 text

OH, THE PAIN! SLOW TREE CONFLICTS MERGING IS CHALLENGING BRANCHES ARE JUST COPIES

Slide 7

Slide 7 text

using svn

Slide 8

Slide 8 text

using git

Slide 9

Slide 9 text

is awesome git

Slide 10

Slide 10 text

It’s distributed! Distributed Version Control System

Slide 11

Slide 11 text

Every repository is equal.

Slide 12

Slide 12 text

You can work offline.

Slide 13

Slide 13 text

Fast as lightning.

Slide 14

Slide 14 text

add status diff log commit branch git mercurial bazaar

Slide 15

Slide 15 text

Very efficient. git clone rails - 53 seconds 40mb, 2356 files, 29045 commits

Slide 16

Slide 16 text

Great branching and merging.

Slide 17

Slide 17 text

Any workflow you want, you got it...

Slide 18

Slide 18 text

Shared repository

Slide 19

Slide 19 text

Blessed repository Linus Torvalds Lieutenants Developers

Slide 20

Slide 20 text

how toinstall

Slide 21

Slide 21 text

Linux: apt-get install git-core Mac OS X: brew install git Windows: chocolatey install msysgit

Slide 22

Slide 22 text

Download from git-scm.com

Slide 23

Slide 23 text

getting started

Slide 24

Slide 24 text

git config --global user.name ... git config --global user.email ...

Slide 25

Slide 25 text

git init

Slide 26

Slide 26 text

master has no special meaning. It’s just a default branch.

Slide 27

Slide 27 text

git add

Slide 28

Slide 28 text

Staging area stores info about what will go into next commit.

Slide 29

Slide 29 text

working directory staging area repository commit checkout the project stage files

Slide 30

Slide 30 text

git commit

Slide 31

Slide 31 text

189f30b664981e4397625791c8ea3bbb5f2279a3 Commit “name” is a 40-digit SHA

Slide 32

Slide 32 text

commit 189f30b... tree e8455... parent(s) nil author Mindaugas... committer Mindaugas... Initial commit

Slide 33

Slide 33 text

tree e8455... blob bc52a... README.md

Slide 34

Slide 34 text

blob bc52a...

Slide 35

Slide 35 text

SVN, CVS, Perforce store differences between commits.

Slide 36

Slide 36 text

Git stores snapshots.

Slide 37

Slide 37 text

commit0 commit1 commit2 tree0 tree1 tree2 blob A blob B blob A blob A2 blob B2 blob B2

Slide 38

Slide 38 text

Basic training complete.

Slide 39

Slide 39 text

and pushing pulling

Slide 40

Slide 40 text

git remote add origin git@git...

Slide 41

Slide 41 text

git push origin master

Slide 42

Slide 42 text

git pull origin master

Slide 43

Slide 43 text

and merging branching

Slide 44

Slide 44 text

git branch name

Slide 45

Slide 45 text

Branch is a reference to the head of a line of work.

Slide 46

Slide 46 text

C0 C1 master feature

Slide 47

Slide 47 text

git checkout name

Slide 48

Slide 48 text

git merge name

Slide 49

Slide 49 text

C0 master C1 C2 F1 F2 feature

Slide 50

Slide 50 text

C0 master C1 C2 F1 F2 feature C3

Slide 51

Slide 51 text

git rebase name

Slide 52

Slide 52 text

C0 master C1 C2 F1 F2 feature

Slide 53

Slide 53 text

C0 master F2 C2 C1 F1 feature

Slide 54

Slide 54 text

merge is fine, but in a lot of cases, rebase is better.

Slide 55

Slide 55 text

Branching - too easy not to do

Slide 56

Slide 56 text

manipulating history

Slide 57

Slide 57 text

git commit --amend

Slide 58

Slide 58 text

git rebase --interactive

Slide 59

Slide 59 text

Interactive rebase lets you: reword, edit, squash, fixup, exec, remove and reorder.

Slide 60

Slide 60 text

You can change history of remote repository with git push --force. Be careful!

Slide 61

Slide 61 text

Rewriting history is fun and useful!

Slide 62

Slide 62 text

svn git-

Slide 63

Slide 63 text

git svn clone http://...

Slide 64

Slide 64 text

git svn rebase ~ svn update

Slide 65

Slide 65 text

git svn dcommit ~ svn commit

Slide 66

Slide 66 text

GitHub

Slide 67

Slide 67 text

The best way to collaborate.

Slide 68

Slide 68 text

More than 1.6 million people, 2.8 million repositories.

Slide 69

Slide 69 text

Used by individuals.

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

And organizations.

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

thoughts closing

Slide 74

Slide 74 text

blame bisect cherry-pick clean cvsimport describe diff fetch filter-branch grep request-pull revert svnimport stash submodule tag and more...

Slide 75

Slide 75 text

git-scm.com gitready.com gitimmersion.com ontwik.com/category/git-github RESOURCES

Slide 76

Slide 76 text

Git != Subversion + Magic

Slide 77

Slide 77 text

The slogan of Subversion for a while was "CVS done right". If you start with that kind of slogan, there's nowhere you can go. There is no way to do CVS right. Linus Torvalds

Slide 78

Slide 78 text

Zach Holman @holman thenounproject.com thanks to:

Slide 79

Slide 79 text

codingfearlessly.com twitter.com/mmozuras github.com/mmozuras thanks!