SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Distributed version control with git
— a brief introduction


Joel Krebs
Slides by Oscar Nierstrasz
Why git?
Bob
Bob
      Carol
Bob
        Carol




Alice
          Ted
Bob
                                 Carol




Alice
                                   Ted

        A recipe for disaster!
What is git?
> Distributed revision control system
> Originally developed by Linus Torvalds for the
  development of the Linux Kernel in 2005
> Focus on speed and efficiency
> Quite a unique design and therefore sometimes a bit
  scary and difficult to understand
The git object model
A “blob” is content under
 version control (a file)

          blob
You can have trees of blobs
    (directories of files)

            tree
 blob
            tree
 blob
           blob
A “commit” is a tree of blobs
     (a set of changes)

           commit


            tree
 blob
            tree
 blob
            blob
Most commits modify
                (or merge) earlier
                     commits
                      commit
       commit
                       tree

        tree
                       blob
blob
        tree
blob
        blob
You can “tag” an
interesting commit

        tag
                         commit
                commit
                          tree

                 tree
                          blob
      blob
                 tree
      blob
                 blob
A graph of commits
may belong to a branch   branch

    tag
                         commit
           commit
                          tree

            tree
                          blob
  blob
            tree
  blob
            blob
HEAD
  “HEAD “is the
  current branch
                   branch

  tag
                   commit
         commit
                    tree

          tree
                    blob
blob
          tree
blob
          blob
HEAD


                  branch


                  commit
     commit




Let’s focus on commits
     and branches
Basic git
Create a git repo
                    HEAD

                    master

                     C0
Tell git to “stage”
              changes
HEAD

master

 C0
HEAD

master   Commit your
          changes
 C1

 C0
Collaborating
John                           Jane


Local repo   Public repo   Local repo



                master


                 C1


                 C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C1           C1            C1


    C0           C0            C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C1            C3


    C1           C0            C1


    C0                         C0
John                                   Jane


    Local repo          Public repo   Local repo



       master              master        master


        C2                  C1            C3


        C1                  C0            C1


        C0                                C0




(nothing new to pull)
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C2            C3


    C1           C1            C1


    C0           C0            C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C2            C3      C2


    C1           C1            C1


    C0           C0            C0
John                                Jane


Local repo    Public repo      Local repo



   master        master           master


    C2            C2               C4


    C1            C1               C3      C2


    C0            C0               C1


                                   C0




             NB: git pull = fetch + merge
John                               Jane


Local repo   Public repo      Local repo



   master       master           master


    C2           C4               C4


    C1           C3      C2       C3      C2


    C0           C1               C1


                 C0               C0
John                                   Jane


Local repo       Public repo      Local repo



   master           master           master


    C4               C4               C4


    C3      C2       C3      C2       C3      C2


    C1               C1               C1


    C0               C0               C0
Branching
and merging
“origin” refers to the
                    remote repo


   HEAD

   master

origin/master

     C1

     C0
HEAD

                master

origin/master    C2

                 C1

                 C0
HEAD
                         tryout
                master

origin/master    C2

                 C1

                 C0
HEAD

                          tryout
                master

origin/master    C2

                 C1      NB: git checkout –b … =
                            branch + checkout
                 C0
HEAD

                         tryout
                master
                          C3
origin/master    C2

                 C1

                 C0
HEAD

         tryout
master
          C3      C5
 C2
                       origin/master
 C1       C4      C6

 C0                    origin/idea
HEAD

              tryout

               C7
master
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
tryout
HEAD
               C7
master
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
HEAD
              tryout
master
               C7
 C8
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
HEAD
                              tryout
                master
                               C7
origin/master    C8
                         C3    C5
                 C2

                 C1      C4    C6

                 C0                    origin/idea
Overview git workflow



               Remote repository
                  fetch               push
                          Local repository
        pull                          commit
               checkout      Index (cache)
               HEAD                   add
                Working directory
Getting started
First steps

> Follow instructions on P2 Blog for installation
> Send your ssh public key to joel.krebs@students.unibe.ch
> Create meaningful commits with according messages
> Hints that make your life easier:
  —Create a .gitignore file
  —Always pull before you push
  —Don’t panic when merge conflicts occur
More to git
More to git …



> Merging and mergetool
> Squashing commits when merging
> Resolving conflicts
> User authentication with ssh
> gitx and other graphical tools
> git configure — remembering your name
> git remote — multiple remote repos
> github — an open source public repo
> …
Resources



   http://git-scm.com/                  http://book.git-scm.com/index.html



                 http://gitready.com/



                                   https://github.com/




http://www.slideshare.net/chacon/getting-git             http://oreilly.com/
http://creativecommons.org/licenses/by-sa/3.0/

Más contenido relacionado

La actualidad más candente

Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
Mediacurrent
 

La actualidad más candente (20)

The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Git - Level 2
Git - Level 2Git - Level 2
Git - Level 2
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git
GitGit
Git
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
git and github
git and githubgit and github
git and github
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Présentation de git
Présentation de gitPrésentation de git
Présentation de git
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git basic
Git basicGit basic
Git basic
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 

Destacado

버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
민태 김
 

Destacado (11)

Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception Handling
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드
 
Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?
 
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
 
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
 

Similar a Quick Introduction to git (8)

Git社内勉強会
Git社内勉強会Git社内勉強会
Git社内勉強会
 
Understanding git
Understanding gitUnderstanding git
Understanding git
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Git data model
Git data modelGit data model
Git data model
 
GIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersjiGIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersji
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
 
Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0
 

Último

Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
russian goa call girl and escorts service
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
sexy call girls service in goa
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
aamir
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
ont65320
 
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort GoaDesi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
russian goa call girl and escorts service
 
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
sexy call girls service in goa
 

Último (20)

Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
 
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRLBhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
 
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
 
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
 
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
 
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
 
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort GoaDesi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
 
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
 
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
 

Quick Introduction to git

  • 1. Distributed version control with git — a brief introduction Joel Krebs Slides by Oscar Nierstrasz
  • 3. Bob
  • 4. Bob Carol
  • 5. Bob Carol Alice Ted
  • 6. Bob Carol Alice Ted A recipe for disaster!
  • 8. > Distributed revision control system > Originally developed by Linus Torvalds for the development of the Linux Kernel in 2005 > Focus on speed and efficiency > Quite a unique design and therefore sometimes a bit scary and difficult to understand
  • 10. A “blob” is content under version control (a file) blob
  • 11. You can have trees of blobs (directories of files) tree blob tree blob blob
  • 12. A “commit” is a tree of blobs (a set of changes) commit tree blob tree blob blob
  • 13. Most commits modify (or merge) earlier commits commit commit tree tree blob blob tree blob blob
  • 14. You can “tag” an interesting commit tag commit commit tree tree blob blob tree blob blob
  • 15. A graph of commits may belong to a branch branch tag commit commit tree tree blob blob tree blob blob
  • 16. HEAD “HEAD “is the current branch branch tag commit commit tree tree blob blob tree blob blob
  • 17. HEAD branch commit commit Let’s focus on commits and branches
  • 19. Create a git repo HEAD master C0
  • 20. Tell git to “stage” changes HEAD master C0
  • 21. HEAD master Commit your changes C1 C0
  • 23. John Jane Local repo Public repo Local repo master C1 C0
  • 24. John Jane Local repo Public repo Local repo master master master C1 C1 C1 C0 C0 C0
  • 25. John Jane Local repo Public repo Local repo master master master C2 C1 C3 C1 C0 C1 C0 C0
  • 26. John Jane Local repo Public repo Local repo master master master C2 C1 C3 C1 C0 C1 C0 C0 (nothing new to pull)
  • 27. John Jane Local repo Public repo Local repo master master master C2 C2 C3 C1 C1 C1 C0 C0 C0
  • 28. John Jane Local repo Public repo Local repo master master master C2 C2 C3 C2 C1 C1 C1 C0 C0 C0
  • 29. John Jane Local repo Public repo Local repo master master master C2 C2 C4 C1 C1 C3 C2 C0 C0 C1 C0 NB: git pull = fetch + merge
  • 30. John Jane Local repo Public repo Local repo master master master C2 C4 C4 C1 C3 C2 C3 C2 C0 C1 C1 C0 C0
  • 31. John Jane Local repo Public repo Local repo master master master C4 C4 C4 C3 C2 C3 C2 C3 C2 C1 C1 C1 C0 C0 C0
  • 33. “origin” refers to the remote repo HEAD master origin/master C1 C0
  • 34. HEAD master origin/master C2 C1 C0
  • 35. HEAD tryout master origin/master C2 C1 C0
  • 36. HEAD tryout master origin/master C2 C1 NB: git checkout –b … = branch + checkout C0
  • 37. HEAD tryout master C3 origin/master C2 C1 C0
  • 38. HEAD tryout master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 39. HEAD tryout C7 master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 40. tryout HEAD C7 master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 41. HEAD tryout master C7 C8 C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 42. HEAD tryout master C7 origin/master C8 C3 C5 C2 C1 C4 C6 C0 origin/idea
  • 43. Overview git workflow Remote repository fetch push Local repository pull commit checkout Index (cache) HEAD add Working directory
  • 45. First steps > Follow instructions on P2 Blog for installation > Send your ssh public key to joel.krebs@students.unibe.ch > Create meaningful commits with according messages > Hints that make your life easier: —Create a .gitignore file —Always pull before you push —Don’t panic when merge conflicts occur
  • 47. More to git … > Merging and mergetool > Squashing commits when merging > Resolving conflicts > User authentication with ssh > gitx and other graphical tools > git configure — remembering your name > git remote — multiple remote repos > github — an open source public repo > …
  • 48. Resources http://git-scm.com/ http://book.git-scm.com/index.html http://gitready.com/ https://github.com/ http://www.slideshare.net/chacon/getting-git http://oreilly.com/