Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git の内部データ構造

Git の内部データ構造

Git がどのようにデータを保持しているかについて解説します。

Shuhei Kagawa

August 20, 2015
Tweet

More Decks by Shuhei Kagawa

Other Decks in Programming

Transcript

  1. (JUͷ಺෦σʔλߏ଄
    4IVIFJ,BHBXB
    .5FDI5BML

    View full-size slide

  2. MTHJU
    '&5$)@)&"%
    )&"%
    DPOpH
    EFTDSJQUJPO
    IPPLT
    JOEFY
    JOGP
    MPHT
    PCKFDUT
    QBDLFESFGT
    SFGT

    View full-size slide

  3. USFFHJUPCKFDUT
    HJUPCKFDUT
    ᵓᴷᴷ
    ᴹᵋᴷᴷDGBFCCFG⒎DGFCGC
    ᵓᴷᴷ
    ᴹᵋᴷᴷCECBFDBFFFD⒎FG
    ᴹᵋᴷᴷEECCFBFECFDEB
    ᵓᴷᴷF
    ᴹᵋᴷᴷFFBFBEGGFCDFGD
    ᵓᴷᴷFC
    ᴹᵋᴷᴷGGGFGEGECBBCBBGCFBCF
    ᵓᴷᴷJOGP
    ᵋᴷᴷQBDL

    View full-size slide

  4. HJUPCKFDUT
    w ϑΝΠϧγεςϜΛར༻ͨ͠,FZ7BMVF4UPSFɻ
    w Ωʔ͸஋ͷ4)"ϋογϡɻ্ܻʢCZUFʣ͕
    σΟϨΫτϦ໊ɺ࢒Γ͕ϑΝΠϧ໊ɻ
    DGBFCCFG⒎DGFCGC
    σΟϨΫτϦ໊
    CZUF
    ϑΝΠϧ໊
    CZUF

    View full-size slide

  5. PCKFDUͷछྨ
    CMPC USFF DPNNJU
    ϑΝΠϧͷத਎
    σΟϨΫτϦ
    ͷΑ͏ͳ΋ͷ
    ͍ΘΏΔίϛοτ

    View full-size slide

  6. PCKFDUͷߏ଄
    CMPC a QVUT)FMMP 8PSMEaO
    PCKFDUͷ
    छྨ
    ۭന αΠζ
    ψϧ
    จࣈ
    σʔλ
    4)"ϋογϡ
    ϑΝΠϧ໊ ϑΝΠϧͷத਎
    [MJCѹॖ
    ϔομ

    View full-size slide

  7. HJUDBUpMFQTIBIBTI

    View full-size slide

  8. CMPC
    QVUT)FMMP 8PSMEaO
    w ϑΝΠϧͷத਎ʮ͚ͩʯ͍࣋ͬͯΔɻ
    w ϑΝΠϧͷ໊લ͸͍࣋ͬͯͳ͍ɻ

    View full-size slide

  9. USFF
    IFMMPKTa4)"ϋογϡʢόΠφϦʣ
    IFMMPSCa4)"ϋογϡʢόΠφϦʣ
    w USFFͱCMPCͷҰཡɻ
    w ֤ߦ͸໊લ΍ϞʔυʢύʔϛογϣϯʣΛ͍࣋ͬͯΔɻ
    w ຊ౰͸վߦͳ͠ɻ

    View full-size slide

  10. DPNNJU
    USFFFBGD⒎FBBDFDDGEF
    BVUIPS4IVIFJ,BHBXBTIVIFJLBHBXB!HNBJMDPN
    DPNNJUUFS4IVIFJ,BHBXBTIVIFJLBHBXB!HNBJMDPN
    )FMMP 8PSME
    w USFF΁ͷࢀরΛҰ͍ͭ࣋ͬͯΔɻ
    w ͋ͱ͸ॻ͍ͨਓͱίϛοτͨ͠ਓɺίϛοτϝοηʔδɻ

    View full-size slide

  11. ֤PCKFDUͷؔ܎
    CMPC
    USFF
    DPNNJU

    CMPC
    IFMMPSC
    (FNpMF
    *OJUJBMDPNNJU

    View full-size slide

  12. ֤PCKFDUͷؔ܎
    CMPC
    USFF
    DPNNJU

    DPNNJU

    USFF
    CMPC
    IFMMPSC
    (FNpMF
    USFF
    MJC
    IFMMPSC
    (FNpMF
    *OJUJBMDPNNJU
    IFMMPSCΛMJC
    ʹೖΕͨ

    View full-size slide

  13. ֤PCKFDUͷؔ܎
    CMPC
    USFF
    DPNNJU

    DPNNJU

    DPNNJU

    USFF
    USFF
    CMPC
    IFMMPSC
    (FNpMF
    USFF
    CMPC
    MJC
    MJC
    IFMMPSC
    (FNpMF
    (FNpMF
    *OJUJBMDPNNJU
    IFMMPSCΛMJC
    ʹೖΕͨ
    ར༻ϥΠϒϥϦ
    Λߋ৽

    View full-size slide

  14. Θ͔Δ͜ͱ
    w DPNNJU͚ͩͰ͸ͳ͘CMPC USFF΋4)"ϋογϡ
    Λ͍࣋ͬͯΔɻ
    w มΘΒͳ͍CMPC USFF͸USFF DPNNJUؒͰڞ༗͞Ε
    Δɻ
    w ϑΝΠϧɾσΟϨΫτϦ໊͸CMPC USFFࣗ਎Ͱ͸ͳ
    ͘਌ͷUSFF͕͍࣋ͬͯΔɻ

    View full-size slide

  15. HJUSFGT
    w HJUSFGTIFBETNBTUFSͱ͔HJUSFGTUBHTWͱ͔ɻ
    w DPNNJUͷ4)"ϋογϡ͕ॻ͍ͯ͋Δ͚ͩɻ

    View full-size slide

  16. HJUJOEFY
    w ࣍ͷDPNNJUʢͷUSFFʣΛ࡞ΔͨΊͷ৘ใ͕Ωϟογϡ͞Ε͍ͯΔɻ
    w มߋ͞ΕͨϑΝΠϧ͚ͩͰ͸ͳ͘શϑΝΠϧ͕ೖ͍ͬͯΔɻ
    w HJUMTpMFTͰ͸ݟ͑ͳ͍͕ɺ࠷ऴߋ৽೔࣌ͳͲ΋ೖ͍ͬͯΔɻ
    HJUMTpMFTTUBHF
    DDGEFECGCDBFDBECDCIFMMPKT
    D⒎BBFGDEEBGCE IFMMPSC

    View full-size slide

  17. ͦ͏͍͑͹ɾɾɾ
    w େ͖ͳϑΝΠϧʹҰߦ଍ͨ͠ΒɺผͷCMPC͕Ͱ͖
    Δɻ
    w ͋Εɺ(JUͬͯϑΝΠϧΛࠩ෼Ͱ࣋ͬͯͳ͍ͷʁ

    View full-size slide

  18. CFGPSF
    HJUPCKFDUT
    ᵓᴷᴷ
    ᴹᵋᴷᴷDGBFCCFG⒎DGFCGC
    ᵓᴷᴷ
    ᴹᵋᴷᴷDEBGEBFGDE
    ᵓᴷᴷ
    ᴹᵋᴷᴷCECBFDBFFFD⒎FG
    ᵓᴷᴷC
    ᴹᵋᴷᴷGFGFCECBFFGBFC
    ᵓᴷᴷDD
    ᴹᵋᴷᴷGEFECGCDBFDBECDC
    ᵓᴷᴷE
    ᴹᵋᴷᴷGCDDEDEGDGFG
    ᵓᴷᴷEC
    ᴹᵋᴷᴷEECCFBFECFDEB
    ᵓᴷᴷF
    ᴹᵋᴷᴷFFBFBEGGFCDFGD
    ᵓᴷᴷFB
    ᴹᵋᴷᴷGD⒎FBBDFDDGEF
    ᵓᴷᴷFC
    ᴹᵋᴷᴷGGGFGEGECBBCBBGCFBCF
    ᵓᴷᴷJOGP
    ᵋᴷᴷQBDL
    HJUPCKFDUT
    ᵓᴷᴷJOGP
    ᴹᵋᴷᴷQBDLT
    ᵋᴷᴷQBDL
    ᵓᴷᴷQBDLFDGDGBFBBGBCFECFGGJEY
    ᵋᴷᴷQBDLFDGDGBFBBGBCFECFGGQBDL
    BGUFS

    View full-size slide

  19. 1BDLpMF
    w JEYͱQBDLͷϖΞɻQBDL͕ຊମͰJEY͕ΠϯσοΫ
    εɻ
    w ෳ਺ͷPCKFDU͕٧Ίࠐ·Ε͍ͯΔɻ
    w ඞཁʹԠͯ͡CMPCΛࠩ෼Ͱอ࣋ɻ
    w HJUWFSJGZQBDLWHJUPCKFDUTQBDLQBDLYYYJEYͰϦε
    τ͕ݟΕΔɻ

    View full-size slide

  20. QMVNCJOHDPNNBOET
    w HJUDBUpMF
    w HJUMTUSFF HJUNLUSFF HJUDPNNJUUSFF
    w HJUSFBEJOEFY HJUXSJUFJOEFY HJUDPNNJUJOEFY

    View full-size slide

  21. ࢀߟ
    w 1SP(JU(JU*OUFSOBMT

    IUUQTHJUTDNDPNCPPLFOW
    w (JU$PNNVOJUZ#PPL*OUFSOBMTBOE1MVNCJOH

    IUUQTTDIBDPOHJUIVCJPHJUCPPLJOEFYIUNM
    w HJU%PDVNFOUBUJPOUFDIOJDBM

    IUUQTHJUIVCDPNHJUHJUUSFFNBTUFS%PDVNFOUBUJPOUFDIOJDBM

    View full-size slide