git! why? how?

Post on 26-Jun-2015

1.016 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

git! why? how?

daniel.kummer@namics.com  October  2011  

VCS history

Svn revisited

Basic svn workflow

So, what’s wrong with this?

When…

…did you last

branch?

…was your last

merge? …were you stressed by a

broken commit*?

* commited by someone else of course

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

Git is optimized for…

Distributed development

Large file sets Merge complex structures Branching Fast operations Robustness

Torvalds’ design criteria

What’s git

Git is better than svn!

Core features

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

Snapshots, Not Differences

Svn

Git

Not centralized…

Svn

…distributed!

Git

Working with git

Staging area

– “index”

or “cache”

Branching Best practice

Into the ring!

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  

Cool Stuff

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?

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 >'

Autocomplete

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

Download file

$ source ~/.git-completion.bash

Add to bash_profile

Graphical clients

SourceTree - OSX GET IT WHILE IT’S FREE!

Tower - OSX

SmartGit - WIN

Work  offline  

Save  space  

Backup  Keep  order  

Save  Bme  

What’s the gain for Namics?

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…

drop svn and use git!

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

top related