SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
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/

Contenu connexe

Tendances

Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requestsBartosz Kosarzycki
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Git slides
Git slidesGit slides
Git slidesNanyak S
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for DocumentationAnne Gentle
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyVivek Parihar
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...Edureka!
 

Tendances (20)

Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git slides
Git slidesGit slides
Git slides
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git and github
Git and githubGit and github
Git and github
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
 
git and github
git and githubgit and github
git and github
 

En vedette

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 HubSpot
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception HandlingLemi Orhan Ergin
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드도형 임
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitLukas Fittl
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드Insub Lee
 
Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Ian Choi
 
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
 
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git민태 김
 

En vedette (12)

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
 
Git basic
Git basicGit basic
Git basic
 
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
 

Similaire à Quick Introduction to git

Understanding git
Understanding gitUnderstanding git
Understanding gitAvik Das
 
Git data model
Git data modelGit data model
Git data modelLin Liu
 
GIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersjiGIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersji3camp
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution beginSeongJae Park
 
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 CETICLa FeWeb
 

Similaire à 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
 

Dernier

Deira call girls 0507330913 Call girls in Deira
Deira call girls 0507330913  Call girls in DeiraDeira call girls 0507330913  Call girls in Deira
Deira call girls 0507330913 Call girls in DeiraMonica Sydney
 
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdfTop IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdfXtreame HDTV
 
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service AvailableCall Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service AvailableNitya salvi
 
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...Call Girls Mumbai
 
Kailashahar Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...
Kailashahar  Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...Kailashahar  Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...
Kailashahar Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...Nitya salvi
 
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Nitya salvi
 
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...HyderabadDolls
 
📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call Girls📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call GirlsNitya salvi
 
Call Girls In Gandhinagar 📞 8617370543 At Low Cost Cash Payment Booking
Call Girls In Gandhinagar 📞 8617370543  At Low Cost Cash Payment BookingCall Girls In Gandhinagar 📞 8617370543  At Low Cost Cash Payment Booking
Call Girls In Gandhinagar 📞 8617370543 At Low Cost Cash Payment BookingNitya salvi
 
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...call girls kolkata
 
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...call girls kolkata
 
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...call girls kolkata
 
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls Agency
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls AgencyHire 💕 8617370543 Kushinagar Call Girls Service Call Girls Agency
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls AgencyNitya salvi
 
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Moradabad Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service AvailableNitya salvi
 
Banda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment BookingBanda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment BookingNitya salvi
 
Pakistani Call girls in Deira 0567006274 Deira Call girls
Pakistani Call girls in Deira 0567006274 Deira Call girlsPakistani Call girls in Deira 0567006274 Deira Call girls
Pakistani Call girls in Deira 0567006274 Deira Call girlsMonica Sydney
 
Bhubaneswar🌹Call Girls Kalpana Mesuem ❤Komal 9777949614 💟 Full Trusted CALL ...
Bhubaneswar🌹Call Girls Kalpana Mesuem  ❤Komal 9777949614 💟 Full Trusted CALL ...Bhubaneswar🌹Call Girls Kalpana Mesuem  ❤Komal 9777949614 💟 Full Trusted CALL ...
Bhubaneswar🌹Call Girls Kalpana Mesuem ❤Komal 9777949614 💟 Full Trusted CALL ...Call Girls Mumbai
 
Dubai Call girls Service 0524076003 Call girls services in Dubai
Dubai Call girls Service 0524076003 Call girls services in DubaiDubai Call girls Service 0524076003 Call girls services in Dubai
Dubai Call girls Service 0524076003 Call girls services in DubaiMonica Sydney
 
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book nowUnnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book nowNitya salvi
 
Turbhe Female Escorts 09167354423 Turbhe Escorts,Call Girls In Turbhe
Turbhe Female Escorts 09167354423  Turbhe Escorts,Call Girls In TurbheTurbhe Female Escorts 09167354423  Turbhe Escorts,Call Girls In Turbhe
Turbhe Female Escorts 09167354423 Turbhe Escorts,Call Girls In TurbhePriya Reddy
 

Dernier (20)

Deira call girls 0507330913 Call girls in Deira
Deira call girls 0507330913  Call girls in DeiraDeira call girls 0507330913  Call girls in Deira
Deira call girls 0507330913 Call girls in Deira
 
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdfTop IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
 
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service AvailableCall Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
 
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...
Bhubaneswar🌹Call Girls Rasulgada ❤Komal 9777949614 💟 Full Trusted CALL GIRLS ...
 
Kailashahar Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...
Kailashahar  Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...Kailashahar  Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...
Kailashahar Call Girl Whatsapp Number 📞 8617370543 | Girls Number for Friend...
 
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Gorakhpur Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
 
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
 
📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call Girls📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call Girls
 
Call Girls In Gandhinagar 📞 8617370543 At Low Cost Cash Payment Booking
Call Girls In Gandhinagar 📞 8617370543  At Low Cost Cash Payment BookingCall Girls In Gandhinagar 📞 8617370543  At Low Cost Cash Payment Booking
Call Girls In Gandhinagar 📞 8617370543 At Low Cost Cash Payment Booking
 
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
 
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...
Call girls Service Dombivli - 9332606886 Our call girls are sure to provide y...
 
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
 
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls Agency
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls AgencyHire 💕 8617370543 Kushinagar Call Girls Service Call Girls Agency
Hire 💕 8617370543 Kushinagar Call Girls Service Call Girls Agency
 
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Moradabad Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Moradabad Just Call 8617370543 Top Class Call Girl Service Available
 
Banda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment BookingBanda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment Booking
 
Pakistani Call girls in Deira 0567006274 Deira Call girls
Pakistani Call girls in Deira 0567006274 Deira Call girlsPakistani Call girls in Deira 0567006274 Deira Call girls
Pakistani Call girls in Deira 0567006274 Deira Call girls
 
Bhubaneswar🌹Call Girls Kalpana Mesuem ❤Komal 9777949614 💟 Full Trusted CALL ...
Bhubaneswar🌹Call Girls Kalpana Mesuem  ❤Komal 9777949614 💟 Full Trusted CALL ...Bhubaneswar🌹Call Girls Kalpana Mesuem  ❤Komal 9777949614 💟 Full Trusted CALL ...
Bhubaneswar🌹Call Girls Kalpana Mesuem ❤Komal 9777949614 💟 Full Trusted CALL ...
 
Dubai Call girls Service 0524076003 Call girls services in Dubai
Dubai Call girls Service 0524076003 Call girls services in DubaiDubai Call girls Service 0524076003 Call girls services in Dubai
Dubai Call girls Service 0524076003 Call girls services in Dubai
 
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book nowUnnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 8617370543 Call Girls in unnao Escort service book now
 
Turbhe Female Escorts 09167354423 Turbhe Escorts,Call Girls In Turbhe
Turbhe Female Escorts 09167354423  Turbhe Escorts,Call Girls In TurbheTurbhe Female Escorts 09167354423  Turbhe Escorts,Call Girls In Turbhe
Turbhe Female Escorts 09167354423 Turbhe Escorts,Call Girls In Turbhe
 

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/