SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
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?

Weitere ähnliche Inhalte

Was ist angesagt?

What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...Simplilearn
 
Batch Message Listener capabilities of the Apache Kafka Connector
Batch Message Listener capabilities of the Apache Kafka ConnectorBatch Message Listener capabilities of the Apache Kafka Connector
Batch Message Listener capabilities of the Apache Kafka ConnectorNeerajKumar1965
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlJeremy Coates
 
WSL Windows Subsystem for Linux
WSL Windows Subsystem for LinuxWSL Windows Subsystem for Linux
WSL Windows Subsystem for LinuxJorge Arteiro
 
V model presentation
V model presentationV model presentation
V model presentationNiat Murad
 
šVoč prezentacia
šVoč prezentaciašVoč prezentacia
šVoč prezentaciamajuska16189
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteriaUmaselvi_R
 
V model Over View (Software Engineering)
V model Over View (Software Engineering) V model Over View (Software Engineering)
V model Over View (Software Engineering) Badar Rameez. CH.
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handlingDhani Ahmad
 

Was ist angesagt? (20)

Git
GitGit
Git
 
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
 
Git
GitGit
Git
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Batch Message Listener capabilities of the Apache Kafka Connector
Batch Message Listener capabilities of the Apache Kafka ConnectorBatch Message Listener capabilities of the Apache Kafka Connector
Batch Message Listener capabilities of the Apache Kafka Connector
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
4. listbox
4. listbox4. listbox
4. listbox
 
WSL Windows Subsystem for Linux
WSL Windows Subsystem for LinuxWSL Windows Subsystem for Linux
WSL Windows Subsystem for Linux
 
System testing
System testingSystem testing
System testing
 
Git Rebase vs Merge
Git Rebase vs MergeGit Rebase vs Merge
Git Rebase vs Merge
 
V model presentation
V model presentationV model presentation
V model presentation
 
šVoč prezentacia
šVoč prezentaciašVoč prezentacia
šVoč prezentacia
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
 
V model Over View (Software Engineering)
V model Over View (Software Engineering) V model Over View (Software Engineering)
V model Over View (Software Engineering)
 
Incremental model
Incremental model Incremental model
Incremental model
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Devops and git basics
Devops and git basicsDevops and git basics
Devops and git basics
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
 

Andere mochten auch

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 Carlos Taborda
 
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 ControlChris Muir
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitLukas Fittl
 
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 guideRohit Arora
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 

Andere mochten auch (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
 

Ähnlich wie Git Sucks but You'll Use it Anyway

Ähnlich wie Git Sucks but You'll Use it Anyway (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
 

Git Sucks but You'll Use it Anyway

  • 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