SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
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?

Más contenido relacionado

La actualidad más candente

Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
Geoffrey De Smet
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Mario Fusco
 

La actualidad más candente (20)

CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
 
Why GC is eating all my CPU?
Why GC is eating all my CPU?Why GC is eating all my CPU?
Why GC is eating all my CPU?
 
Pipeline oriented programming
Pipeline oriented programmingPipeline oriented programming
Pipeline oriented programming
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
 
Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
Pushing the rule engine to its limits with drools planner (parisjug 2010-11-09)
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
 
Laravel Design Patterns
Laravel Design PatternsLaravel Design Patterns
Laravel Design Patterns
 
Unit Test and TDD
Unit Test and TDDUnit Test and TDD
Unit Test and TDD
 
Lazy java
Lazy javaLazy java
Lazy java
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)
 
kotlinx.serialization
kotlinx.serializationkotlinx.serialization
kotlinx.serialization
 
Backend driven UI on mobile apps
Backend driven UI on mobile appsBackend driven UI on mobile apps
Backend driven UI on mobile apps
 
JSON Array Indexes in MySQL
JSON Array Indexes in MySQLJSON Array Indexes in MySQL
JSON Array Indexes in MySQL
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Advanced kapacitor
Advanced kapacitorAdvanced kapacitor
Advanced kapacitor
 
DDD with Behat
DDD with BehatDDD with Behat
DDD with Behat
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
 
Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk
 
The Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingThe Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern Matching
 

Destacado

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

Destacado (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
 

Similar a 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
 

Similar a 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