git! why? how?

35
git! why? how? [email protected] October 2011

Upload: daniel-kummer

Post on 26-Jun-2015

1.017 views

Category:

Technology


0 download

DESCRIPTION

Why should you use git today instead of centralized version management systems like svn.

TRANSCRIPT

Page 1: Git! Why? How?

git! why? how?

[email protected]  October  2011  

Page 2: Git! Why? How?

VCS history

Page 3: Git! Why? How?
Page 4: Git! Why? How?

Svn revisited

Page 5: Git! Why? How?

Basic svn workflow

So, what’s wrong with this?

Page 6: Git! Why? How?

When…

…did you last

branch?

…was your last

merge? …were you stressed by a

broken commit*?

* commited by someone else of course

Page 7: Git! Why? How?
Page 8: Git! Why? How?

It began with the linux kernel…

•  Birthday April 3, 2005

•  Linus Torvalds invented it “over night”, after BitKeeper became proprietary

•  Tech-Talk: Linus Torvalds on git www.youtube.com/watch?v=4XpnKHJAok8

Page 9: Git! Why? How?

Git is optimized for…

Distributed development

Large file sets Merge complex structures Branching Fast operations Robustness

Page 10: Git! Why? How?

Torvalds’ design criteria

Page 11: Git! Why? How?

What’s git

Page 12: Git! Why? How?
Page 13: Git! Why? How?

Git is better than svn!

Page 14: Git! Why? How?

Core features

Page 15: Git! Why? How?

How does it work?

•  SHA-1 is King – Universal public identifier – Every object has it

(Blobs, Trees Commits, Tags) •  Multiple protocols – http ssh git •  Efficient object store •  Disk is cheap – everyone has entire repo •  Easy branching and merging

Page 16: Git! Why? How?

Snapshots, Not Differences

Svn

Git

Page 17: Git! Why? How?

Not centralized…

Svn

Page 18: Git! Why? How?

…distributed!

Git

Page 19: Git! Why? How?

Working with git

Page 20: Git! Why? How?

Staging area

– “index”

or “cache”

Page 21: Git! Why? How?

Branching Best practice

Page 22: Git! Why? How?

Into the ring!

Page 23: Git! Why? How?

Git @ Namics

know.namics  • buildrun/Git+bei+Namics  

• Schnipsel  

git.namics  • ssh  public  key  authenBcaBon  

• access?  contact  a  git  admin  

(scm.namics)  • Git  • SVN  • Jenkins  • Bamboo  • Jira  • LDAP  

Page 24: Git! Why? How?
Page 25: Git! Why? How?

Cool Stuff

Page 26: Git! Why? How?

Tons of Tools

git-archive Export a tree as tar/zip

git-bisect Find broken commit

git-cherry-pick Selective merging

git-revert Add a second revert commit

git-blame Who wrote this?

Page 27: Git! Why? How?

Bash aliases - I’m lazy! alias ga='git add .' alias gcam='git commit -am' alias grh='git reset HEAD --hard' alias gs='git status' alias gb='git branch' alias gc='git checkout' alias gcm='git checkout master' alias gcs='git checkout staging' alias gcd='git checkout development' alias gph='git push' alias gpt='git push --tags' alias gpl='git pull' alias gm='git merge' alias gmm='git merge master' alias gms='git merge staging' alias gmd='git merge development' alias gba='git branch -a' alias gt='git tag' alias gpt='git push --tags' alias garc='git archive HEAD --format=zip >'

Page 28: Git! Why? How?

Autocomplete

h"ps://raw.github.com/git/git/master/contrib/comple6on/git-­‐comple6on.bash  

Download file

$ source ~/.git-completion.bash

Add to bash_profile

Page 29: Git! Why? How?

Graphical clients

Page 30: Git! Why? How?

SourceTree - OSX GET IT WHILE IT’S FREE!

Page 31: Git! Why? How?

Tower - OSX

Page 32: Git! Why? How?

SmartGit - WIN

Page 33: Git! Why? How?

Work  offline  

Save  space  

Backup  Keep  order  

Save  Bme  

What’s the gain for Namics?

Page 34: Git! Why? How?

Resources

Great Book, and its free! http://progit.org/

Cheatsheets http://www.ndpsoftware.com/git-cheatsheet.html http://byte.kde.org/~zrusin/git/git-cheat-sheet.svg http://help.github.com/git-cheat-sheets/

Your search engine of choice…

Page 35: Git! Why? How?

drop svn and use git!

http://know.namics.com/display /buildrun/Git+bei+Namics