git
TRANSCRIPT
![Page 1: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/1.jpg)
GitAn intro to Git Source Control Management
![Page 2: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/2.jpg)
Say what?
Source Control Management
like SVN, CVS,.. but better!
Linus Throvalds (april 2005)
Linux Kernel
Junio Hamano (july 2005)
a stupid person!
![Page 3: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/3.jpg)
Ok, but why?
Offline
Distributed
Branching
Because it’s fucking fast, that’s why!
![Page 4: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/4.jpg)
How git works Offline
world
local
![Page 5: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/5.jpg)
How git works
server
local
local
local
Distributed
![Page 6: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/6.jpg)
How git works Branching
master mergecommit commit
commitcommit
commit
commitfeature
feature
![Page 7: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/7.jpg)
Repository
unstaged
stagedlocal
repositoryremote
repository
git add <files>
git commit git push
![Page 8: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/8.jpg)
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
![Page 9: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/9.jpg)
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
![Page 10: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/10.jpg)
Cool featuresUhm.. Okay...
![Page 11: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/11.jpg)
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
![Page 12: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/12.jpg)
Cool features
fetch changes from another branch
rebase
master
feature
commit 1 commit 2 commit 4
commit 3
![Page 13: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/13.jpg)
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
![Page 14: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/14.jpg)
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
![Page 15: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/15.jpg)
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
![Page 16: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/16.jpg)
GitNub
![Page 17: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/17.jpg)
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
![Page 18: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/18.jpg)
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
![Page 19: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/19.jpg)
Q & A
![Page 20: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/20.jpg)
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
![Page 21: Git](https://reader033.vdocument.in/reader033/viewer/2022060110/555c233bd8b42a09438b4abb/html5/thumbnails/21.jpg)
About us
Jeroen Jacobs & Jan De Poorter
@jeroen_j & @defv
Openminds