Slide 1

Slide 1 text

Git vs SVN @denkeni

Slide 2

Slide 2 text

Git - first impressions • Distributed Version Control System • Created by Linus Torvalds for Linux kernel project management. • Fast, lightweight. • GitHub • "Local branching on the cheap"

Slide 3

Slide 3 text

But git is more complex and requires more management than svn, definitely.

Slide 4

Slide 4 text

Git SVN git clone svn checkout git checkout xxx.m svn revert xxx.m git checkout $branch_name svn switch $branch_url git checkout $commit svn merge -r301:300 xxx.m svn commit git reset --hard HEAD svn revert -R . git pull (= git fetch + git merge) svn update git revert $commit -

Slide 5

Slide 5 text

Remote-dependent(SVN) vs Local-Remote(Git)

Slide 6

Slide 6 text

Uncommitted (Local) Committed (Remote) svn commit

Slide 7

Slide 7 text

Uncommitted (Local) Committed (Remote) svn commit Working space/directory Index / Staging area Local repository Remote repository git add xxx.m git commit git push

Slide 8

Slide 8 text

A typical case of SVN One trunk development

Slide 9

Slide 9 text

svn update (solve conflicts) svn commit trunk Remote Local

Slide 10

Slide 10 text

Remote Local trunk

Slide 11

Slide 11 text

A typical case of git Branch merging development

Slide 12

Slide 12 text

master Remote Local master git branch $branch_name git checkout $branch_name

Slide 13

Slide 13 text

Remote Local master branch git commit master

Slide 14

Slide 14 text

Remote Local master git checkout master branch master

Slide 15

Slide 15 text

Remote Local master git merge $branch_name git push branch master (other people pushed something)

Slide 16

Slide 16 text

Remote Local master branch master

Slide 17

Slide 17 text

(Git-SVN: Use Git client for SVN remote repository) My Git-SVN Flow

Slide 18

Slide 18 text

trunk master Remote Local

Slide 19

Slide 19 text

Remote Local master trunk branch

Slide 20

Slide 20 text

Remote Local master trunk git svn rebase (≈git pull) (≈svn update) branch

Slide 21

Slide 21 text

Remote Local trunk branch master

Slide 22

Slide 22 text

Remote Local trunk master git rebase master (solve conflicts) branch

Slide 23

Slide 23 text

Remote Local trunk master branch

Slide 24

Slide 24 text

Remote Local trunk master git rebase master -i (solve conflicts) (squash commits into one) branch

Slide 25

Slide 25 text

Remote Local trunk master branch

Slide 26

Slide 26 text

Remote Local trunk master branch git merge branch

Slide 27

Slide 27 text

Remote Local trunk branch master

Slide 28

Slide 28 text

Remote Local trunk master git svn dcommit (≈git push) branch

Slide 29

Slide 29 text

Remote Local trunk master branch

Slide 30

Slide 30 text

"A successful Git branching model." Git Flow

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Learning Resources • 《Pro Git》by Scott Chacon(範例多易學,有中文版) http://git-scm.com/book/ • Try Git: Code School(線上學 Git 指令) https://try.github.io/ • ihower 的《Git版本控制系統》 http://ihower.tw/git/ • Will 保哥的《30 天精通 Git 版本控管》(深入淺出) https://github.com/doggy8088/Learn-Git-in-30-days • GitSvnComparison https://git.wiki.kernel.org/index.php/GitSvnComparsion • Tech Talk: Linus Torvalds on git http://youtu.be/4XpnKHJAok8