SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Git Sucks
How git sucks and why you'll use it anyway
Intro
●   David Whittington
●   Self Employed
    –   xForty
    –   ParentProxy
Goals
●   Convince you to at least try git
●   Give you enough information to get
    started
Experience?
●   What VCS experience do you have?
    –   RCS?
    –   CVS/SVN?
    –   Perforce?
    –   Git/hg/bazaar?
Version Control History
●   In the beginning ... RCS
    –   Lock – modify – unlock
    –   Single file
    –   Makes collaboration difficult
Version Control History
●   CVS/SVN
    –   Copy – modify – merge
    –   Central server
    –   Makes forking + experimentation difficult
Version Control History
●   Distributed version control
    –   Clone – modify – commit – fetch – merge ...
    –   Lots of workflow options
    –   Examples: Git, Mercurial, Bazaar-ng,
        Monotone
What is Git?
●   Distributed VCS system
●   Created in 2005 by Torvalds following
    Bitkeeper fallout
●   DAG based (as opposed to diff based)
Git Sucks
●   DVCS = complexity
●   Unintuitive
●   Documentation also distributed
●   Code can be obtuse
Why You'll Use it Anyway
●   Distributed VCS is Good
    –   Encourages contributions
    –   Encourages experimentation (branches are
        easy)
    –   Offline access rocks
Why You'll Use it Anyway




   from http://blog.orebokech.com/2008/06/updated-debian-vcs-statistics.html
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
Why You'll Use it Anyway
●   It really is powerful
    –   Unixy
    –   Fast
    –   SVN bridge
Why You'll Use it Anyway



      Github rocks!
Why You'll Use it Anyway




    Hypnotoad Commands It!
Using Git - Configuration
$ git config --global user.name “David ...”
$ git config --global user.email “djwhitt@...”
$ git config --list
user.name=”David Whittington”
user.email=”djwhitt@gmail.com”
$ cat ~/.gitconfig
[user]
  name = David Whittington
  email = “djwhitt@gmail.com”
Using Git – Cloning a Repo
$ git clone git://github.com/rails/rails.git
$ cd rails
Using Git – Creating a Repo
$ mkdir deathray
$ cd deathray
$ git init
Using Git – Adding a File
$ echo “deathray - a ray that kills” > README
$ git add README
$ git commit -m “initial commit”
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”
Using Git – The Index
Object Dir   Index   Working Dir




 Commits

  Trees      Blobs      Files

  Blobs
Using Git – Branches
$ git branch
* master
$ git branch fusion
$ git branch
 fusion
* master
$ git checkout fusion
$ git branch
* fusion
 master
Using Git – Branches
Using Git – Branches
$ echo “reactor core” > reactor
$ git add reactor
$ git commit -m “adding reactor”
$ ls
README reactor
$ git checkout master
$ ls
README
Using Git – Branches
Using Git - Merging
$ git branch
 fusion
* master
$ echo “focussing lens” > lens
$ git add lens
$ git commit -m “adding lens”
Using Git - Merging
Using Git - Merging
$ git merge fusion
Using Git - Merging
Using Git - Rebasing
$ git branch
 fusion
* master
$ echo “focussing lens” > lens
$ git add lens
$ git commit -m “adding lens”
Using Git - Rebasing
Using Git - Rebasing
$ git rebase fusion
Using Git - Rebasing
Using Git – Git Status
$ git status
# Changed but not updated:
#       modified:    lens
# Untracked files:
#       amplifier
Using Git – Git Log
$ git log
commit c23d31c9d34c7bf540a8e57f615f735f9ecdc2f2
Author: David Whittington <djwhitt@gmail.com>
Date:    Tue Oct 14 14:25:55 2008 -0400


      adding lens
...
Using Git - .gitignore
$ cat .gitignore
# swap files
*.swp
# temp dir
/tmp
Using Git - Aliases
$ git config --global alias.co checkout
$ git co fusion
Using Git – Awesome Stuff
$ git add --interactive
$ git add --patch
$ git stash
Using Git - Github
Using Git - Github
Using Git - Github
Using Git – Remote + Push
$ git remote add github 
> git@github.com:djwhitt/deathray.git
$ git push github master
Using Git – Fetch, Merge, Pull
$ git fetch github
$ git merge github/master


or...


$ git pull github master
Using Git - Tracking
$ git config branch.master.remote github

$ git config branch.master.merge github/master
Stuff I Didn't Cover
●   Workflow
●   Conflicts
●   Many more git commands
●   Internals
●   Other hosting options
Resources
●   http://git.or.cz/index.html
●   http://git-scm.com/
●   http://www.gitcasts.com/
●   http://peepcode.com/
    –   screencast and pdf book
    –   not free
Questions?

Contenu connexe

Tendances

Кути, утворені при перетині двох прямих січною
Кути, утворені при перетині двох прямих січноюКути, утворені при перетині двох прямих січною
Кути, утворені при перетині двох прямих січною
Formula.co.ua
 
Math1003 1.1 - Sets of Numbers
Math1003 1.1 - Sets of NumbersMath1003 1.1 - Sets of Numbers
Math1003 1.1 - Sets of Numbers
gcmath1003
 
Презентація:Перпендикуляр і похила. Їх властивості
Презентація:Перпендикуляр і похила. Їх властивостіПрезентація:Перпендикуляр і похила. Їх властивості
Презентація:Перпендикуляр і похила. Їх властивості
sveta7940
 
GPGPU Seminar (GPGPU and CUDA Fortran)
GPGPU Seminar (GPGPU and CUDA Fortran)GPGPU Seminar (GPGPU and CUDA Fortran)
GPGPU Seminar (GPGPU and CUDA Fortran)
智啓 出川
 
Презентація:Трикутник і його елементи. Види трикутників.
Презентація:Трикутник і його елементи. Види трикутників.Презентація:Трикутник і його елементи. Види трикутників.
Презентація:Трикутник і його елементи. Види трикутників.
sveta7940
 
Biến đổi và đổi biến hàm tích phân bậc 2
Biến đổi và đổi biến hàm tích phân bậc 2Biến đổi và đổi biến hàm tích phân bậc 2
Biến đổi và đổi biến hàm tích phân bậc 2
Thế Giới Tinh Hoa
 
практичне заняття 2
практичне заняття 2практичне заняття 2
практичне заняття 2
cdecit
 

Tendances (20)

Презентація Чолій Л. Г. ВПИСАНІ ТА ОПИСАНІ ЧОТИРИКУТНИКИ
Презентація Чолій Л. Г. ВПИСАНІ ТА ОПИСАНІ ЧОТИРИКУТНИКИПрезентація Чолій Л. Г. ВПИСАНІ ТА ОПИСАНІ ЧОТИРИКУТНИКИ
Презентація Чолій Л. Г. ВПИСАНІ ТА ОПИСАНІ ЧОТИРИКУТНИКИ
 
Management of cataract
Management of cataractManagement of cataract
Management of cataract
 
Кути, утворені при перетині двох прямих січною
Кути, утворені при перетині двох прямих січноюКути, утворені при перетині двох прямих січною
Кути, утворені при перетині двох прямих січною
 
Math1003 1.1 - Sets of Numbers
Math1003 1.1 - Sets of NumbersMath1003 1.1 - Sets of Numbers
Math1003 1.1 - Sets of Numbers
 
Презентація:Перпендикуляр і похила. Їх властивості
Презентація:Перпендикуляр і похила. Їх властивостіПрезентація:Перпендикуляр і похила. Їх властивості
Презентація:Перпендикуляр і похила. Їх властивості
 
Знаходження дробу від числа
Знаходження дробу від числаЗнаходження дробу від числа
Знаходження дробу від числа
 
GPGPU Seminar (GPGPU and CUDA Fortran)
GPGPU Seminar (GPGPU and CUDA Fortran)GPGPU Seminar (GPGPU and CUDA Fortran)
GPGPU Seminar (GPGPU and CUDA Fortran)
 
Pseudophakia
PseudophakiaPseudophakia
Pseudophakia
 
Ptosis
PtosisPtosis
Ptosis
 
Logic mệnh đề
Logic mệnh đề Logic mệnh đề
Logic mệnh đề
 
Ophthalmology OSCE
Ophthalmology OSCEOphthalmology OSCE
Ophthalmology OSCE
 
Презентація:Трикутник і його елементи. Види трикутників.
Презентація:Трикутник і його елементи. Види трикутників.Презентація:Трикутник і його елементи. Види трикутників.
Презентація:Трикутник і його елементи. Види трикутників.
 
平方剰余
平方剰余平方剰余
平方剰余
 
Biến đổi và đổi biến hàm tích phân bậc 2
Biến đổi và đổi biến hàm tích phân bậc 2Biến đổi và đổi biến hàm tích phân bậc 2
Biến đổi và đổi biến hàm tích phân bậc 2
 
Інтеграл та його застосування
Інтеграл та його застосуванняІнтеграл та його застосування
Інтеграл та його застосування
 
EYELID DISORDER
EYELID DISORDEREYELID DISORDER
EYELID DISORDER
 
EXAMINATION OF ANTERIOR SEGMENT OF EYE
EXAMINATION OF ANTERIOR SEGMENT OF EYEEXAMINATION OF ANTERIOR SEGMENT OF EYE
EXAMINATION OF ANTERIOR SEGMENT OF EYE
 
Instruments
InstrumentsInstruments
Instruments
 
піраміда 1
піраміда 1піраміда 1
піраміда 1
 
практичне заняття 2
практичне заняття 2практичне заняття 2
практичне заняття 2
 

En vedette

Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
Joel Krebs
 

En vedette (7)

Carlos Taborda / Launch Solid / - This is Exactly How I Killed My Startup
Carlos Taborda / Launch Solid / - This is Exactly How I Killed My Startup Carlos Taborda / Launch Solid / - This is Exactly How I Killed My Startup
Carlos Taborda / Launch Solid / - This is Exactly How I Killed My Startup
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version Control
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 

Similaire à Why Git Sucks and you'll use it anyways

Enterprise git
Enterprise gitEnterprise git
Enterprise git
Pedro Melo
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexy
Ailsa126
 

Similaire à Why Git Sucks and you'll use it anyways (20)

GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git training
Git trainingGit training
Git training
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git
GitGit
Git
 
Git Heaven with Wakanda
Git Heaven with WakandaGit Heaven with Wakanda
Git Heaven with Wakanda
 
Git basics
Git basicsGit basics
Git basics
 
Git! Why? How?
Git! Why? How?Git! Why? How?
Git! Why? How?
 
Git basics
Git basicsGit basics
Git basics
 
Git'in on Windows
Git'in on WindowsGit'in on Windows
Git'in on Windows
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Enterprise git
Enterprise gitEnterprise git
Enterprise git
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
Git: be social
Git: be socialGit: be social
Git: be social
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexy
 
Git cheat-sheets
Git cheat-sheetsGit cheat-sheets
Git cheat-sheets
 

Why Git Sucks and you'll use it anyways

  • 1. Git Sucks How git sucks and why you'll use it anyway
  • 2. Intro ● David Whittington ● Self Employed – xForty – ParentProxy
  • 3. Goals ● Convince you to at least try git ● Give you enough information to get started
  • 4. Experience? ● What VCS experience do you have? – RCS? – CVS/SVN? – Perforce? – Git/hg/bazaar?
  • 5. Version Control History ● In the beginning ... RCS – Lock – modify – unlock – Single file – Makes collaboration difficult
  • 6. Version Control History ● CVS/SVN – Copy – modify – merge – Central server – Makes forking + experimentation difficult
  • 7. Version Control History ● Distributed version control – Clone – modify – commit – fetch – merge ... – Lots of workflow options – Examples: Git, Mercurial, Bazaar-ng, Monotone
  • 8. What is Git? ● Distributed VCS system ● Created in 2005 by Torvalds following Bitkeeper fallout ● DAG based (as opposed to diff based)
  • 9. Git Sucks ● DVCS = complexity ● Unintuitive ● Documentation also distributed ● Code can be obtuse
  • 10. Why You'll Use it Anyway ● Distributed VCS is Good – Encourages contributions – Encourages experimentation (branches are easy) – Offline access rocks
  • 11. Why You'll Use it Anyway from http://blog.orebokech.com/2008/06/updated-debian-vcs-statistics.html
  • 12. 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
  • 13. Why You'll Use it Anyway ● It really is powerful – Unixy – Fast – SVN bridge
  • 14. Why You'll Use it Anyway Github rocks!
  • 15. Why You'll Use it Anyway Hypnotoad Commands It!
  • 16. Using Git - Configuration $ git config --global user.name “David ...” $ git config --global user.email “djwhitt@...” $ git config --list user.name=”David Whittington” user.email=”djwhitt@gmail.com” $ cat ~/.gitconfig [user] name = David Whittington email = “djwhitt@gmail.com”
  • 17. Using Git – Cloning a Repo $ git clone git://github.com/rails/rails.git $ cd rails
  • 18. Using Git – Creating a Repo $ mkdir deathray $ cd deathray $ git init
  • 19. Using Git – Adding a File $ echo “deathray - a ray that kills” > README $ git add README $ git commit -m “initial commit”
  • 20. 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”
  • 21. Using Git – The Index Object Dir Index Working Dir Commits Trees Blobs Files Blobs
  • 22. Using Git – Branches $ git branch * master $ git branch fusion $ git branch fusion * master $ git checkout fusion $ git branch * fusion master
  • 23. Using Git – Branches
  • 24. Using Git – Branches $ echo “reactor core” > reactor $ git add reactor $ git commit -m “adding reactor” $ ls README reactor $ git checkout master $ ls README
  • 25. Using Git – Branches
  • 26. Using Git - Merging $ git branch fusion * master $ echo “focussing lens” > lens $ git add lens $ git commit -m “adding lens”
  • 27. Using Git - Merging
  • 28. Using Git - Merging $ git merge fusion
  • 29. Using Git - Merging
  • 30. Using Git - Rebasing $ git branch fusion * master $ echo “focussing lens” > lens $ git add lens $ git commit -m “adding lens”
  • 31. Using Git - Rebasing
  • 32. Using Git - Rebasing $ git rebase fusion
  • 33. Using Git - Rebasing
  • 34. Using Git – Git Status $ git status # Changed but not updated: # modified: lens # Untracked files: # amplifier
  • 35. Using Git – Git Log $ git log commit c23d31c9d34c7bf540a8e57f615f735f9ecdc2f2 Author: David Whittington <djwhitt@gmail.com> Date: Tue Oct 14 14:25:55 2008 -0400 adding lens ...
  • 36. Using Git - .gitignore $ cat .gitignore # swap files *.swp # temp dir /tmp
  • 37. Using Git - Aliases $ git config --global alias.co checkout $ git co fusion
  • 38. Using Git – Awesome Stuff $ git add --interactive $ git add --patch $ git stash
  • 39. Using Git - Github
  • 40. Using Git - Github
  • 41. Using Git - Github
  • 42. Using Git – Remote + Push $ git remote add github > git@github.com:djwhitt/deathray.git $ git push github master
  • 43. Using Git – Fetch, Merge, Pull $ git fetch github $ git merge github/master or... $ git pull github master
  • 44. Using Git - Tracking $ git config branch.master.remote github $ git config branch.master.merge github/master
  • 45. Stuff I Didn't Cover ● Workflow ● Conflicts ● Many more git commands ● Internals ● Other hosting options
  • 46. Resources ● http://git.or.cz/index.html ● http://git-scm.com/ ● http://www.gitcasts.com/ ● http://peepcode.com/ – screencast and pdf book – not free