Slide 1

Slide 1 text

Make the code work for you with #Git Tomáš Jukin @Inza

Slide 2

Slide 2 text

Tomáš Jukin @Inza #Objective-C #RubyOnRails #Git

Slide 3

Slide 3 text

A long story short...

Slide 4

Slide 4 text

...about a SCM tool

Slide 5

Slide 5 text

...about a SCM tool Source Code Management

Slide 6

Slide 6 text

SCM? Centralized Distributed

Slide 7

Slide 7 text

SCM? Centralized Distributed Git, Mercurial, ... CVS, SVN, ...

Slide 8

Slide 8 text

Why SCM? FTP sucks Mail sucks Dropbox sucks USB drive sucks We NEED to share code! ...and...

Slide 9

Slide 9 text

Why SCM? FTP sucks Mail sucks Dropbox sucks USB drive sucks We NEED to share code! ...and... So?

Slide 10

Slide 10 text

Why SCM? Which SCM?

Slide 11

Slide 11 text

Which SCM? CVS is a history SVN is centralized Mercurial can’t rebase ... Today, we NEED to: ...and... be independant be productive work offline have backup grow

Slide 12

Slide 12 text

Which SCM? CVS is a history SVN is centralized Mercurial can’t rebase ... Today, we NEED to: ...and... So? be independant be productive work offline have backup grow

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Distributed SCM By geeks around Linux Kernel The most powerful SCM out there

Slide 15

Slide 15 text

Tools Ecosystem Submodules GitHub Rebase Cherry-pick Stash

Slide 16

Slide 16 text

http://git-scm.com/ http://book.git-scm.com/ http://progit.org/book/

Slide 17

Slide 17 text

Workflow Me You

Slide 18

Slide 18 text

Workflow Me You

Slide 19

Slide 19 text

Workflow Me You

Slide 20

Slide 20 text

Workflow

Slide 21

Slide 21 text

Workflow Working Copy

Slide 22

Slide 22 text

Workflow Working Copy

Slide 23

Slide 23 text

Workflow Working Copy Local Repo

Slide 24

Slide 24 text

Workflow Working Copy Local Repo

Slide 25

Slide 25 text

Workflow Working Copy Index (stage) Local Repo

Slide 26

Slide 26 text

Workflow Working Copy Index (stage) Local Repo Remote Local

Slide 27

Slide 27 text

Workflow Working Copy Index (stage) Local Repo Remote Local

Slide 28

Slide 28 text

Workflow Working Copy Index (stage) Local Repo Remote Repo Remote Local

Slide 29

Slide 29 text

Workflow Working Copy Index (stage) Local Repo Remote Repo Remote Local

Slide 30

Slide 30 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add Remote Local

Slide 31

Slide 31 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add Remote Local

Slide 32

Slide 32 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit Remote Local

Slide 33

Slide 33 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit Remote Local

Slide 34

Slide 34 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push Remote Local

Slide 35

Slide 35 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push Remote Local

Slide 36

Slide 36 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch Remote Local

Slide 37

Slide 37 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch Remote Local

Slide 38

Slide 38 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch merge Remote Local

Slide 39

Slide 39 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch merge Remote Local

Slide 40

Slide 40 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch pull or rebase merge Remote Local

Slide 41

Slide 41 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch pull or rebase merge Remote Local

Slide 42

Slide 42 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch pull or rebase checkout HEAD merge Remote Local

Slide 43

Slide 43 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add commit push fetch pull or rebase checkout HEAD merge Remote Local

Slide 44

Slide 44 text

Workflow Working Copy Index (stage) Local Repo Remote Repo add remove commit push fetch pull or rebase checkout HEAD merge Remote Local

Slide 45

Slide 45 text

Workflow Working Copy Index (stage) Local Repo Remote Repo remove push fetch pull or rebase checkout HEAD merge Remote Local add commit

Slide 46

Slide 46 text

Workflow Working Copy Index (stage) Local Repo Remote Repo remove push fetch pull or rebase checkout HEAD merge Remote Local add commit commit -a

Slide 47

Slide 47 text

Workflow Working Copy Index (stage) Local Repo Remote Repo remove push fetch pull or rebase checkout HEAD merge Remote Local add commit commit -a add -A

Slide 48

Slide 48 text

Workflow Working Copy Index (stage) Local Repo Remote Repo remove push fetch pull or rebase checkout HEAD merge Remote Local add commit commit -a add -A ?

Slide 49

Slide 49 text

Workflow Working Copy Index (stage) Local Repo Remote Repo remove push fetch pull or rebase checkout HEAD merge Remote Local add commit commit -a add -A ? status

Slide 50

Slide 50 text

Creation (in code) git clone [email protected]/foo.git foo_dir cd foo_dir Local Repo mkdir foo_dir cd foo_dir git init ...or...

Slide 51

Slide 51 text

Creation (in code) git clone [email protected]/foo.git foo_dir cd foo_dir Local Repo mkdir foo_dir cd foo_dir git init ...or... clone url

Slide 52

Slide 52 text

Creation (in code) Remote Repo mkdir foo.git cd foo.git git init --bare

Slide 53

Slide 53 text

Workflow (in code) git add -a git commit -m “Updated foo class” git push

Slide 54

Slide 54 text

Workflow (in code) git add -a git commit -m “Updated foo class” git push

Slide 55

Slide 55 text

Workflow (in code) git pull git fetch git merge bar_branch ...or...

Slide 56

Slide 56 text

Installation Windows msysgit - http://goo.gl/YdToL MacOS brew install git Linux apt-get install git

Slide 57

Slide 57 text

GUI Windows TortoiseGit - http://goo.gl/9Gfhn SmartGit - http://goo.gl/P8QqD MacOS GitX (L) - http://goo.gl/AMiqc Linux Choose yours - http://goo.gl/TebDq

Slide 58

Slide 58 text

Next? git flow “Just one approach to solve branches, releases and versions”

Slide 59

Slide 59 text

Next? Links Interactive Git Cheatsheet - http://goo.gl/8yMZY GitHub - http://github.com semver - http://semver.org git flow (about) - http://goo.gl/MAF6m git flow (CLI tool) - http://goo.gl/IbOJr

Slide 60

Slide 60 text

@Inza Tomáš Jukin @JuicymoCZ