Slide 1

Slide 1 text

Git An intro to Git Source Control Management

Slide 2

Slide 2 text

Say what? Source Control Management like SVN, CVS,.. but better! Linus Throvalds (april 2005) Linux Kernel Junio Hamano (july 2005) a stupid person!

Slide 3

Slide 3 text

Ok, but why? Offline Distributed Branching Because it’s fucking fast, that’s why!

Slide 4

Slide 4 text

How git works Offline world local

Slide 5

Slide 5 text

How git works server local local local Distributed

Slide 6

Slide 6 text

How git works Branching master merge commit commit commit commit commit commit feature feature

Slide 7

Slide 7 text

Repository unstaged staged local repository remote repository git add <files> git commit git push

Slide 8

Slide 8 text

Our Workflow git checkout -b cool_feature do some fun code stuff, drink a mojito git fetch master git rebase origin/master git checkout master git merge cool_feature

Slide 9

Slide 9 text

Useful commands and files git init git add git commit git push git pull git clone .gitignore ‣ repository setup ‣ add files to queue for next commit ‣ commit queued files ‣ push commit(s) to remote repository ‣ fetch changes from remote repository ‣ clone repository into a local directory ‣ ignore specific files by adding them here

Slide 10

Slide 10 text

Cool features Uhm.. Okay...

Slide 11

Slide 11 text

Cool features do some cool stuff git stash fix an irritating bug git commit -a -m “Farewell, you bug!” git stash apply do some more cool stuff stash

Slide 12

Slide 12 text

Cool features fetch changes from another branch rebase master feature commit 1 commit 2 commit 4 commit 3

Slide 13

Slide 13 text

Cool features fetch changes from another branch rebase master feature commit 1 commit 2 commit 4 commit 3 1 2 4 1 2 3 4

Slide 14

Slide 14 text

Cool features Find the code change that introduced a bug git bisect start git bisect bad git log git bisect good revision git bisect good/bad bisect ‣ start bisect session ‣ mark current revision as bad ‣ search a working revision ‣ mark the working one as good ‣ bisect until you find the bug

Slide 15

Slide 15 text

Cool features cherry-pick Apply a change from another commit into current branch git log git checkout branch git cherry-pick revision ‣ search the right commit ‣ checkout the branch you want ‣ apply commit into branch

Slide 16

Slide 16 text

GitNub

Slide 17

Slide 17 text

Git vs SVN Git SVN Distributed Single Repository Branches partial checkout Performance Access Control Repository size Shorter revision numbers Powerful, little more complicated more GUI tools

Slide 18

Slide 18 text

git-svn using git local if you have a remote svn repository use git on your local machine staging seperate commits branches push your commits to your svn repository

Slide 19

Slide 19 text

Q & A

Slide 20

Slide 20 text

Useful resources http://www.kernel.org/pub/software/scm/git/docs/ http://peepcode.com/products/git https://github.com/ http://github.com/Caged/gitnub/tree/master http://git.or.cz/gitwiki/GitSvnComparsion

Slide 21

Slide 21 text

About us Jeroen Jacobs & Jan De Poorter @jeroen_j & @defv Openminds