Why Git Sucks and you'll use it anyways

47
Git Sucks How git sucks and why you'll use it anyway

description

I found these slides on the internet, and wanted to share them.I personally love Git, but they seem interesting to hear the opinion from someone back in '08.

Transcript of Why Git Sucks and you'll use it anyways

Page 1: Why Git Sucks and you'll use it anyways

Git SucksHow git sucks and why you'll use it anyway

Page 2: Why Git Sucks and you'll use it anyways

Intro

● David Whittington● Self Employed

– xForty– ParentProxy

Page 3: Why Git Sucks and you'll use it anyways

Goals

● Convince you to at least try git● Give you enough information to get

started

Page 4: Why Git Sucks and you'll use it anyways

Experience?

● What VCS experience do you have?– RCS?– CVS/SVN?– Perforce?– Git/hg/bazaar?

Page 5: Why Git Sucks and you'll use it anyways

Version Control History

● In the beginning ... RCS– Lock – modify – unlock– Single file– Makes collaboration difficult

Page 6: Why Git Sucks and you'll use it anyways

Version Control History

● CVS/SVN– Copy – modify – merge– Central server– Makes forking + experimentation difficult

Page 7: Why Git Sucks and you'll use it anyways

Version Control History

● Distributed version control– Clone – modify – commit – fetch – merge ...– Lots of workflow options– Examples: Git, Mercurial, Bazaar-ng,

Monotone

Page 8: Why Git Sucks and you'll use it anyways

What is Git?

● Distributed VCS system● Created in 2005 by Torvalds following

Bitkeeper fallout● DAG based (as opposed to diff based)

Page 9: Why Git Sucks and you'll use it anyways

Git Sucks

● DVCS = complexity● Unintuitive● Documentation also distributed● Code can be obtuse

Page 10: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

● Distributed VCS is Good– Encourages contributions– Encourages experimentation (branches are

easy)– Offline access rocks

Page 11: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

from http://blog.orebokech.com/2008/06/updated-debian-vcs-statistics.html

Page 12: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

● These projects are using it:– Linux Kernel– X.org– Samba– Wine– Ruby on Rails– ... more at http://git.or.cz/gitwiki/GitProjects

Page 13: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

● It really is powerful– Unixy– Fast– SVN bridge

Page 14: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

Github rocks!

Page 15: Why Git Sucks and you'll use it anyways

Why You'll Use it Anyway

Hypnotoad Commands It!

Page 16: Why Git Sucks and you'll use it anyways

Using Git - Configuration

$ git config --global user.name “David ...”

$ git config --global user.email “djwhitt@...”

$ git config --list

user.name=”David Whittington”

user.email=”[email protected]

$ cat ~/.gitconfig

[user]

name = David Whittington

email = “[email protected]

Page 17: Why Git Sucks and you'll use it anyways

Using Git – Cloning a Repo

$ git clone git://github.com/rails/rails.git

$ cd rails

Page 18: Why Git Sucks and you'll use it anyways

Using Git – Creating a Repo

$ mkdir deathray

$ cd deathray

$ git init

Page 19: Why Git Sucks and you'll use it anyways

Using Git – Adding a File

$ echo “deathray - a ray that kills” > README

$ git add README

$ git commit -m “initial commit”

Page 20: Why Git Sucks and you'll use it anyways

Using Git – Modifying a File

$ echo “most awesome deathray ever” >> README

$ git add README

$ git commit -m “added detail to README”

or ...

$ echo “most awesome deathray ever” >> README

$ git commit -a -m “added detail to README”

Page 21: Why Git Sucks and you'll use it anyways

Using Git – The Index

Commits

Trees

Blobs

Object Dir Index Working Dir

Blobs Files

Page 22: Why Git Sucks and you'll use it anyways

Using Git – Branches

$ git branch

* master

$ git branch fusion

$ git branch

fusion

* master

$ git checkout fusion

$ git branch

* fusion

master

Page 23: Why Git Sucks and you'll use it anyways

Using Git – Branches

Page 24: Why Git Sucks and you'll use it anyways

Using Git – Branches

$ echo “reactor core” > reactor

$ git add reactor

$ git commit -m “adding reactor”

$ ls

README reactor

$ git checkout master

$ ls

README

Page 25: Why Git Sucks and you'll use it anyways

Using Git – Branches

Page 26: Why Git Sucks and you'll use it anyways

Using Git - Merging

$ git branch

fusion

* master

$ echo “focussing lens” > lens

$ git add lens

$ git commit -m “adding lens”

Page 27: Why Git Sucks and you'll use it anyways

Using Git - Merging

Page 28: Why Git Sucks and you'll use it anyways

Using Git - Merging

$ git merge fusion

Page 29: Why Git Sucks and you'll use it anyways

Using Git - Merging

Page 30: Why Git Sucks and you'll use it anyways

Using Git - Rebasing

$ git branch

fusion

* master

$ echo “focussing lens” > lens

$ git add lens

$ git commit -m “adding lens”

Page 31: Why Git Sucks and you'll use it anyways

Using Git - Rebasing

Page 32: Why Git Sucks and you'll use it anyways

Using Git - Rebasing

$ git rebase fusion

Page 33: Why Git Sucks and you'll use it anyways

Using Git - Rebasing

Page 34: Why Git Sucks and you'll use it anyways

Using Git – Git Status

$ git status

# Changed but not updated:

# modified: lens

# Untracked files:

# amplifier

Page 35: Why Git Sucks and you'll use it anyways

Using Git – Git Log

$ git log

commit c23d31c9d34c7bf540a8e57f615f735f9ecdc2f2

Author: David Whittington <[email protected]>

Date: Tue Oct 14 14:25:55 2008 -0400

adding lens

...

Page 36: Why Git Sucks and you'll use it anyways

Using Git - .gitignore

$ cat .gitignore

# swap files

*.swp

# temp dir

/tmp

Page 37: Why Git Sucks and you'll use it anyways

Using Git - Aliases

$ git config --global alias.co checkout

$ git co fusion

Page 38: Why Git Sucks and you'll use it anyways

Using Git – Awesome Stuff

$ git add --interactive

$ git add --patch

$ git stash

Page 39: Why Git Sucks and you'll use it anyways

Using Git - Github

Page 40: Why Git Sucks and you'll use it anyways

Using Git - Github

Page 41: Why Git Sucks and you'll use it anyways

Using Git - Github

Page 42: Why Git Sucks and you'll use it anyways

Using Git – Remote + Push

$ git remote add github \

> [email protected]:djwhitt/deathray.git

$ git push github master

Page 43: Why Git Sucks and you'll use it anyways

Using Git – Fetch, Merge, Pull

$ git fetch github

$ git merge github/master

or...

$ git pull github master

Page 44: Why Git Sucks and you'll use it anyways

Using Git - Tracking

$ git config branch.master.remote github

$ git config branch.master.merge github/master

Page 45: Why Git Sucks and you'll use it anyways

Stuff I Didn't Cover

● Workflow● Conflicts● Many more git commands● Internals● Other hosting options

Page 46: Why Git Sucks and you'll use it anyways

Resources

● http://git.or.cz/index.html● http://git-scm.com/● http://www.gitcasts.com/● http://peepcode.com/

– screencast and pdf book– not free

Page 47: Why Git Sucks and you'll use it anyways

Questions?