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

すごいGit楽しく学ぼう

 すごいGit楽しく学ぼう

MIXI ENGINEERS

May 12, 2015
Tweet

More Decks by MIXI ENGINEERS

Other Decks in Programming

Transcript

  1. Learn You a Git
    for Great Good!

    View full-size slide

  2. ͦ΋ͦ΋ɺGitͬͯ
    ԿͷͨΊʹ͋ΔΜͩΖ͏ʁ

    View full-size slide

  3. Git͸ɺνʔϜͰͭͷ։ൃʹ
    औΓ૊Ή͜ͱΛՄೳʹ͠·͢ʂ

    View full-size slide

  4. Git͕ແ͍ͱʜʜ
    Կ͕มΘ͔ͬͨ෼͔Μͳ͍ʂ
    ٸʹಈ͔ͳ͘ͳͬͨΜ͚ͩͲʜʜ
    ࠓ͔Βࢲ͕։ൃ͢ΔͷͰɺΈΜͳ։ൃΛࢭΊͯʂ
    ͜ͷίʔυ୭͕ॻ͍ͨΜͩΖ͏ʁ

    View full-size slide

  5. ਖ਼௚ਏ͍ʂ

    View full-size slide

  6. Git͕͋Ε͹ʂ
    ;Ή;Ήɺ͜͏͍ͬͨมߋ͕ՃΘͬͨͷ͔ʂ
    ಈ͔ͳ͘ͳ͚ͬͨͲɺ͙͢ʹલʹ໭ͤͨʂ
    ਺ඦਓͰ΋Ұॹʹ։ൃͰ͖ΔΑʂ
    ͜ͷΫιίʔυΛॻ͍ͨͷ͸ɺ˓˓͞Μ͔ʜʜ

    View full-size slide

  7. ΈΜͳͰ։ൃͰָ͖͍ͯ͠ʂ
    ✌ Т✌
    ࡾ✌ Т
    ✌ࡾ ✌`Т

    View full-size slide

  8. w ͱΓ͋͑ͣ࢖ͬͯΈΑ͏ʂ
    w ίϛοτͱϒϥϯνʹ͍ͭͯਖ਼͘͠ཧղ͠Α͏
    w ྺ࢙ΛऔΓࠐΉ
    w མึर͍
    ࠓ೔ͷ༧ఆ

    View full-size slide

  9. w ͱΓ͋͑ͣ࢖ͬͯΈΑ͏ʂ
    w ίϛοτͱϒϥϯνʹ͍ͭͯਖ਼͘͠ཧղ͠Α͏
    w ྺ࢙ΛऔΓࠐΉ
    w མึर͍
    ࠓ೔ͷ༧ఆ

    View full-size slide

  10. ࢖ͬͯΈΑ͏ʂͷͦͷલʹ
    $ git config --global user.name "Amy Mikushi"
    $ git config --global user.email "[email protected]"
    Gitʹࣗݾ঺հ
    ͜͜Ͱొ࿥ͨ͠৘ใ͕(JUͷૢ࡞ʹ͍ͭͯճΔʂ

    View full-size slide

  11. ͸͡ΊͯΈΑ͏
    $ mkdir books
    $ cd books
    $ git init
    GitϦϙδτϦΛ࡞੒͠Α͏
    ϦϙδτϦ͸ɺόʔδϣϯ؅ཧ͢ΔͨΊͷ
    ஷଂݿͷ͜ͱͰ͢

    View full-size slide

  12. $ find .
    Α͘Ͱ͖·ͨ͠ʂ
    ͜ΕͰbooks

    View full-size slide

  13. ঢ়ଶͷ֬ೝ
    $ git status
    git

    View full-size slide

  14. ϑΝΠϧͷ௥Ճ
    Untracked

    View full-size slide

  15. ௥ՃΛ֬ೝ
    Changes

    View full-size slide

  16. ͸͡Ίͯͷίϛοτ
    εςʔδϯάΤϦΞʹஔ͍ͨϑΝΠϧΛεφοϓγϣο
    τͱͯ͠ɺGit

    View full-size slide

  17. εςʔδϯάΤϦΞͱϦϙδτϦ
    Sherlock.txt
    Crusoe.txt
    ࡞ۀσΟϨΫτϦ εςʔδϯάΤϦΞ (JUϦϙδτϦ
    git add
    ίϛοτ͢Δ४උ͕Ͱ͖ͨΒgit

    View full-size slide

  18. εςʔδϯάΤϦΞͱϦϙδτϦ
    Sherlock.txt
    Crusoe.txt
    ࡞ۀσΟϨΫτϦ εςʔδϯάΤϦΞ (JUϦϙδτϦ
    git add
    ίϛοτ͢Δ४උ͕Ͱ͖ͨΒgit

    View full-size slide

  19. Sherlock.txt
    Crusoe.txt
    ࡞ۀσΟϨΫτϦ εςʔδϯάΤϦΞ (JUϦϙδτϦ
    git commit
    add

    View full-size slide

  20. Sherlock.txt
    Crusoe.txt
    ࡞ۀσΟϨΫτϦ εςʔδϯάΤϦΞ (JUϦϙδτϦ
    git commit
    add

    View full-size slide

  21. ྺ࢙ΛΈΑ͏
    มߋΛอଘͰ͖ΔΑ͏ʹͳΓ·ͨ͠ʂ
    มߋΛίϛοτͱͯ͠ͲΜͲΜੵΈॏͶ͍ͯ͘͜ͱ͕େࣄͰ͢
    ͲΜͳมߋ͖͚ͯͨͬ͠ʜʁͱͳͬͨΒྺ࢙ΛৼΓฦΓ·͠ΐ͏ʂ
    $ git log
    աڈͷมߋ ίϛοτ
    ͕ҰཡͰ͖·͢
    ผͷϑΝΠϧΛ௥Ճ͢ΔίϛοτΛߦ͍ɺ࠶౓

    View full-size slide

  22. ϦϞʔτϦϙδτϦΛ࢖ͬͯΈΔ
    ಉ͡ঢ়ଶ͕ϦϞʔτʹ΋อଘͰ͖·͢
    ͍ͭͰ΋໭ͤΔ͠ɺଞͷਓ΋Ҿͬுͬͯ͜Ε·͢
    ·ͣ͸ɺGitHubͰϕΞϦϙδτϦΛ࡞੒͠Α͏ʂ
    https://github.com/new
    ϕΞϦϙδτϦ͸࡞ۀ༻σΟϨΫτϦΛ࣋ͨͳ͍
    .gitͷΈͷϦϙδτϦͰ͢

    View full-size slide

  23. ϦϞʔτϦϙδτϦΛొ࿥͢Δ
    ϕΞϦϙδτϦΛ࡞੒ͨ͠ΒϦϞʔτϦϙδτϦͱͯ͠
    ొ࿥͠Α͏
    $ git remote add origin \
    [email protected]:/books.git
    ొ࿥ͨ͠ϦϞʔτϦϙδτϦ͸ɺ$

    View full-size slide

  24. खݩͷมߋΛ্͛ͯΈΑ͏
    $ git push -u origin master
    ϦϞʔτϒϥϯνΛࣗಈͰ௥੻͢ΔΑ͏ʹઃఆ͢Δ
    ͔࣍Βpull

    View full-size slide

  25. ڞಉ։ൃ͜ͱ͸͡Ί
    $ cd ..
    $ git clone [email protected]:/books.git alt_books
    GitΛ࢖͏͜ͱͰෳ਺ਓͰ͔ΜͨΜʹ։ൃͰ͖·͢ʂ
    ࠓ͔Βผਓ ͷؾ࣋ͪ
    ʹͳͬͯମݧͯ͠Έ·͠ΐ͏
    ·ͣ͸ϦϞʔτϦϙδτϦΛखݩʹऔΓࠐΈ·͢
    alt_booksͱ͍͏໊લͰϦϙδτϦΛෳ੡(clone)Ͱ͖
    ͨʂ

    View full-size slide

  26. ڞಉ։ൃ͜ͱ͸͡Ί
    $ cd alt_books
    $ vim Crusoe.txt
    $ git add Crusoe.txt
    $ git commit
    $ git push
    Ͱ͸ɺalt_booksͰ࡞ۀΛ͍͖ͯ͠·͠ΐ͏
    pushͨ͠ΒɺGitHubͰ֬ೝͯ͠ΈΑ͏ʂ

    View full-size slide

  27. มߋΛऔΓࠐΉ
    $ cd ../books
    $ git pull
    ଞਓͷߦͬͨ࡞ۀ alt_booksͰߦͬͨ࡞ۀ
    Λ
    booksʹऔΓࠐΜͰΈ·͠ΐ͏
    ͦΕʹ͸pull

    View full-size slide

  28. มߋΛ֬ೝʂ
    $ vim Sherlock.txt
    $ git diff
    diff

    View full-size slide

  29. มߋΛ֬ೝʂ1BSU
    $ git add Sherlock.txt
    $ git diff --staged
    ͨͩ୯ʹgit

    View full-size slide

  30. ݩʹ໭͢
    $ git reset Sherlock.txt
    ૉ੖Β͍͠ʂमਖ਼ՕॴΛ͙͢ʹ֬ೝ͢Δ͜ͱ͕Ͱ͖ΔΑ
    ͏ʹͳΓ·ͨ͠
    ࣍͸ݩʹ໭͢ํ๏Λ֮͑·͠ΐ͏
    addΛऔΓফ͢ʹ͸git

    View full-size slide

  31. ݩʹ໭͢
    $ vim Sherlock.txt
    $ git checkout -- Sherlock.txt
    ͜ΕͰ޷͖ͳ͚ͩBEEΛͨ͠ΓɺBEEΛऔΓফͨ͠ΓͰ
    ͖·͢
    ࣍͸ϑΝΠϧࣗମΛલճͷίϛοτঢ়ଶʹ໭͢ํ๏Ͱ͢
    ίϛοτͯ͠ͳ͍มߋ͸ফ͑ͪΌͬͯݩʹ໭ͤͳ͍ʂ

    View full-size slide

  32. ϒϥϯνΛ࡞Ζ͏
    Gitͷ࢖͍ํΛ΄ͱΜͲϚελʔ͠·ͨ͠ʂ
    ࠷ޙʹGitͷϒϥϯνػೳΛֶͼ·͠ΐ͏
    ϒϥϯν͸ɺݱࡏͷίϐʔΛ࡞੒͢ΔػೳͰ͢
    ػೳ௥Ճ΍όάमਖ਼ͷࡍ͸ϒϥϯνΛ੾ͬͯ࡞ۀΛਐΊ·͢
    ੾ͬͨϒϥϯν͔Β͸͍ͭͰ΋ݩͷmasterϒϥϯνʹ໭ͬ
    ͯ͘Δ͜ͱ͕Ͱ͖·͢
    master͸σϑΥϧτͷϒϥϯν໊Ͱ͢

    View full-size slide

  33. ϒϥϯνΛ࡞Ζ͏
    $ git branch clean_up
    ϒϥϯνΛ੾Δʹ͸ɺgit

    View full-size slide

  34. ϒϥϯνΛ੾Γସ͑ͯΈΑ͏
    $ git checkout clean_up
    clean_up

    View full-size slide

  35. ϑΝΠϧͷ࡟আ
    $ git rm '*.txt'
    $ git commit -m "Remove all files"
    clean_up

    View full-size slide

  36. ϒϥϯνͰߦͬͨ࡞ۀΛऔΓࠐ΋͏
    $ git checkout master
    clean_up

    View full-size slide

  37. ϒϥϯνͰߦͬͨ࡞ۀΛऔΓࠐ΋͏
    $ git merge clean_up
    clean_up

    View full-size slide

  38. ϒϥϯνͷ࡟আ
    $ git branch -d clean_up
    ඞཁͷͳ͘ͳͬͨclean_upϒϥϯνΛ࡟আ͠Α͏
    git

    View full-size slide

  39. ࠷ޙͷpush
    $ git push
    ࠷ޙʹࠓ·ͰߦͬͨมߋΛGitHubʹ΋൓өͤ͞Α͏ʂ
    Git͕࢖͑ΔΑ͏ʹͳͬͨʂ

    View full-size slide

  40. w ͱΓ͋͑ͣ࢖ͬͯΈΑ͏ʂ
    w ίϛοτͱϒϥϯνʹ͍ͭͯਖ਼͘͠ཧղ͠Α͏
    w ྺ࢙ΛऔΓࠐΉ
    w མึर͍
    ࠓ೔ͷ༧ఆ

    View full-size slide

  41. ίϛοτͱϒϥϯνͬͯ
    Ͳ͏͍͏࢓૊ΈͳΜͩΖ͏ʁ

    View full-size slide

  42. ίϛοτͱϒϥϯνΛཧղ͢Δ͜ͱͰ
    GitΛγϯϓϧʹཧղͰ͖·͢

    View full-size slide

  43. ίϛοτͱ͸ʁ
    ίϛοτ͸༷ʑͳ৘ใΛ͍࣋ͬͯ·͢
    w ϦϏδϣϯ
    w Tree

    View full-size slide

  44. ίϛοτͱ͸ʁ
    ίϛοτ͸༷ʑͳ৘ใΛ͍࣋ͬͯ·͢
    w ϦϏδϣϯ
    w Tree

    View full-size slide

  45. ίϛοτʹ͸਌͕͍Δ
    ͭલͷίϛοτͷϦϏδϣϯΛ࣋ͭͷͰίϛοτʹ͸
    ਌͕͍Δʂ

    ৽͍͠ίϛοτ͔Βݹ͍ίϛοτ͸؆୯ʹ୧ΕΔ

    View full-size slide

  46. ࠷ݹͷίϛοτ·Ͱ୧ΕΔ
    ίϛοτΛ୧͍ͬͯ͘ͱඞͣҰ൪࠷ݹͷίϛοτ·Ͱ
    ୧Γண͚Δʂ
    ࠷ݹ
    ͋ΔͭͷίϛοτΛݟΕ͹ɺͦͷྺ࢙͕෼͔Δ

    View full-size slide

  47. ίϛοτ͸෼͔͚ͬͨͲ
    ϒϥϯν͸ʁ

    View full-size slide

  48. ୯ͳΔಛఆͷίϛοτΛࢦͨ͠
    ϙΠϯλͷΑ͏ͳ΋ͷͰ͢ʂ

    View full-size slide

  49. ϒϥϯν
    σϑΥϧτͷϒϥϯν໊͸master
    ϒϥϯνͷઌ಄Λࢦ͢ϦϑΝϨϯε͸ɺ
    ςΩετͰϦϏδϣϯ SHA-1
    ͕อଘ͞Ε͍ͯ·͢


    View full-size slide

  50. ϒϥϯν
    ৽ͨͳnewͱ͍͏໊લͷϒϥϯνΛ࡞੒ͯ͠ΈΔ
    $ git branch new


    View full-size slide

  51. ϒϥϯν
    $ git branch new




    ৽͍͠ͷ͕ग़དྷͨʂ
    ৽ͨͳnewͱ͍͏໊લͷϒϥϯνΛ࡞੒ͯ͠ΈΔ

    View full-size slide

  52. ϒϥϯνͷجຊ͸͜Ε͚ͩʂ
    ୯ͳΔϙΠϯλͳͷͰɺϒϥϯν໊͕
    ࢖͑Δॴ͸ϦϏδϣϯ͕࢖͑Δ͠
    ͦͷٯ΋વΓ

    View full-size slide

  53. ϒϥϯνͷࢬ෼͔Ε




    ͜ͷঢ়ଶ͔ΒOFXʹίϛοτ͍ͯ͘͠ͱʜʜ

    View full-size slide

  54. ϒϥϯνͷࢬ෼͔Ε




    Μʁ

    View full-size slide

  55. ϒϥϯνͷࢬ෼͔Ε





    ࢬ෼͔Εͨ͠ʂ

    View full-size slide

  56. ϒϥϯνͷࢬ෼͔Ε
    newϒϥϯν͚ͩมߋ͞Ε
    masterϒϥϯνʹ͸Өڹ͕ͳ͍ʂ






    View full-size slide

  57. ࢲ͸Ͳ͜ʹ͍ΔΜͰ͠ΐ͏͔ʜʜ
    git

    View full-size slide

  58. HEADϦϑΝϨϯε







    $ git checkout master

    View full-size slide

  59. HEADϦϑΝϨϯε







    $ git checkout master

    View full-size slide

  60. HEADϦϑΝϨϯε
    HEADͷҐஔ͕੾ΓସΘͬͨʂ
    HEAD͕෇͍͍ͯΔϒϥϯν͸ಛघͳಈ͖Λ͢Δ
    ෼͔Γ΍͍͢Α͏ʹ·ͣଞʹϒϥϯνΛ੾ͬͯΈΔ








    $ git branch other

    View full-size slide

  61. HEADϦϑΝϨϯε
    ͜͜Ͱίϛοτͯ͠ΈΔͱʜʜ








    master

    View full-size slide

  62. HEADͰࢀর͞Ε͍ͯΔϒϥϯν͸
    ίϛοτ͢ΔͨͼʹҠಈ͢Δ

    View full-size slide

  63. ίϛοτͱϒϥϯνʹ͍ͭͯ
    ෼͔ͬͨʂ

    View full-size slide

  64. w ͱΓ͋͑ͣ࢖ͬͯΈΑ͏ʂ
    w ίϛοτͱϒϥϯνʹ͍ͭͯਖ਼͘͠ཧղ͠Α͏
    w ྺ࢙ΛऔΓࠐΉ
    w མึर͍
    ࠓ೔ͷ༧ఆ

    View full-size slide

  65. ྺ࢙ΛऔΓࠐΉϚʔδͬͯ
    Ͳ͏͍͏࣌ʹ࢖͏ΜͩΖ͏ʁ

    View full-size slide

  66. ΘΓͱͲ͜Ͱ΋࢖͏ʂ

    View full-size slide

  67. ɾνʔϜͰ։ൃ͍ͯ͠Δ࣌ʹ
    ଞͷਓͷมߋΛऔΓࠐΉͱ͖
    ɾਓͰ։ൃ͍ͯ͠Δ࣌ʹෳ਺ͷ
    ϒϥϯνΛͭʹ·ͱΊΔͱ͖

    View full-size slide

  68. ΘΓͱΑ͋͘Δύλʔϯ
    Αʔ͠ɺमਖ਼΋ऴΘͬͨ͠αʔόʹ
    push

    View full-size slide

  69. ͳͥpushͰ͖ͳ͍ʁ








    remote repo my repo
    ͢Ͱʹ৽͍͠
    ίϛοτ͕ʂ

    View full-size slide

  70. ͜ͷঢ়ଶͰ͸pushͰ͖·ͤΜ
    Ͳͷίϛοτ͕masterϒϥϯνͷ࠷৽͔෼͔Βͳ͘ͳ
    Δ͔ΒͰ͢
    ҎԼͷΑ͏ͳঢ়ଶΛ࡞Δ͜ͱ͸ग़དྷ·ͤΜ







    View full-size slide

  71. Ͳ͏ͨ͠Β͍͍ͷʁ
    Ұ౓खݩʹremote

    View full-size slide

  72. มߋΛऔΓࠐΉ








    remote repo my repo
    $ git pull origin master

    View full-size slide





  73. remote repo
    my repo






    มߋ͕औΓࠐ·Εͨʂ

    View full-size slide





  74. remote repo
    my repo






    $ git push origin master

    View full-size slide







  75. remote repo my repo






    pushͰ͖ͨʂ

    View full-size slide

  76. ΈΜͳͰ։ൃ
    ͭͷϒϥϯνΛผʑʹมߋͨ࣌͠͸ɺ
    ଞਓͷมߋΛϚʔδͯ͠push

    View full-size slide

  77. ͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ
    ΘΓͱ͍Ζ͍ΖͳॴͰ࢖͏ϚʔδͰ͕͢ɺ
    ࣮͸͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ͕͋Γ·͢ʂ
    • merge

    View full-size slide

  78. ͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ
    ΘΓͱ͍Ζ͍ΖͳॴͰ࢖͏ϚʔδͰ͕͢ɺ
    ࣮͸͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ͕͋Γ·͢ʂ
    • merge

    View full-size slide








  79. $ git merge topic --ff
    merge

    View full-size slide








  80. தͷਓ
    ʮtopicϒϥϯνͬͯmasterͷࠩ෼શ෦
    ɹؚΜͰΔ͠ɺҰॹʹͪ͠Ό͑͹Α͘Ͷʁʯ
    merge

    View full-size slide

  81. தͷਓ
    ʮϚʔδͨ͠Αʔʯ






    merge

    View full-size slide

  82. ͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ
    ΘΓͱ͍Ζ͍ΖͳॴͰ࢖͏ϚʔδͰ͕͢ɺ
    ࣮͸͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ͕͋Γ·͢ʂ
    • merge

    View full-size slide

  83. ͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ
    ΘΓͱ͍Ζ͍ΖͳॴͰ࢖͏ϚʔδͰ͕͢ɺ
    ࣮͸͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ͕͋Γ·͢ʂ
    • merge

    View full-size slide









  84. $ git merge topic --squash
    merge

    View full-size slide

  85. தͷਓ
    ʮtopicͷมߋ಺༰Λѹॖ͠Α͏ʂʯ
    தͷਓʮͭͷύονʹѹॖͰ͖ͨʂʯ


    merge

    View full-size slide

  86. Ϛʔδ͢Δ಺༰Λѹॖ͠ɺࠩ෼Λݱࡏͷίϛοτʹ
    ৐͚ͬΔʂ
    ࠩ෼͸εςʔδϯάΤϦΞʹ৐ͤΒΕΔ͚ͩͳͷͰɺ
    ίϛοτ͸ࣗ෼Ͱ΍Δඞཁ͕͋Δ
    merge

    View full-size slide

  87. ͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ
    ΘΓͱ͍Ζ͍ΖͳॴͰ࢖͏ϚʔδͰ͕͢ɺ
    ࣮͸͍Ζ͍Ζͳྺ࢙ͷऔΓࠐΈํ͕͋Γ·͢ʂ
    • merge

    View full-size slide

  88. ϦϕʔεͬͯԿʁ
    ϚʔδͱԿ͕ҧ͏ͷʁ

    View full-size slide

  89. rebase







    '
    ͜Ε͕Ϧϕʔεʂ

    View full-size slide

  90. ࣮ࡍϦϕʔε͕Ͳ͏͍͏͜ͱΛ
    ͢Δͷ͔ͭͣͭݟ͍ͯ͜͏

    View full-size slide

  91. rebase
    topicϒϥϯνΛrebase͍ͨ͠








    View full-size slide

  92. rebase








    $ git rebase master

    View full-size slide

  93. '
    rebase
    ·ͣίϛοτͷมߋ಺༰ΛͦΕͧΕύονʹ͢Δ

    View full-size slide

  94. rebase
    topicϒϥϯνΛmasterͱ
    ಉ͡ҐஔʹҠಈͤ͞Δ









    View full-size slide

  95. rebase
    ࡞੒͓͍ͯͨ͠ύονΛͭͣͭ
    ॱʹద༻ͯ͠ίϛοτ͍ͯ͘͠







    View full-size slide

  96. rebase

    ࠩ෼Λద༻ͯ͠ίϛοτ







    View full-size slide

  97. ର৅ͷϒϥϯνͷ্ʹݱࡏͷϒϥϯνΛ࡞Γ௚͠·͢
    rebaseʹΑͬͯ࡞ΒΕͨίϛοτ͸ಉ͡಺༰͚ͩͲผͷ
    ίϛοτʹͳΔͷͰ஫ҙͰ͢ʂ
    git

    View full-size slide

  98. ผͷίϛοτʹͳΔ
    w ϦϏδϣϯ
    w Tree

    View full-size slide

  99. ΍ͬͯ͸͍͚ͳ͍rebase
    ίϛοτͷ৘ใ͕มΘͬͯ͠·͏ͷͰɺ
    طʹpush͞Ε͍ͯΔϒϥϯνΛrebaseͯ͠͸͍͚·ͤΜ
    ଞਓ͕push

    View full-size slide

  100. w ͱΓ͋͑ͣ࢖ͬͯΈΑ͏ʂ
    w ίϛοτͱϒϥϯνʹ͍ͭͯਖ਼͘͠ཧղ͠Α͏
    w ྺ࢙ΛऔΓࠐΉ
    w མึर͍
    ࠓ೔ͷ༧ఆ

    View full-size slide

  101. Gitͷ৭ʑͳٕΛֶ΅͏ʂ

    View full-size slide

  102. ͜Ε͚ͩ͸֮͑Α͏
    $ git

    View full-size slide

  103. gitίϚϯυͰ͸ɺGitͷΑ͘࢖͏ίϚϯυΛҰཡ͢Δ
    ͜ͱ͕ग़དྷ·͢
    ίϚϯυͷৄࡉͳઆ໌Λݟ͍ͨ࣌͸ɺmanΛར༻͠·
    ͠ΐ͏
    ྫ͑͹ɺmergeίϚϯυʹ͍ͭͯৄ͘͠஌Γ͍ͨͱ͖͸
    ϋΠϑϯͰܨ͛ͯೖྗ͠·͢
    $ man git-merge
    ͜Ε͚ͩ͸֮͑Α͏

    View full-size slide

  104. Ϛʔδ͢Δ࣌ʹ(JU͚ͩͰ͸ղܾͰ͖ͳ͍͜ͱ͕͋Γ·͢
    ͦΕ͕ίϯϑϦΫτͰ͢
    ίϯϑϦΫτͨ͠৔߹͸ਓ͕ؒղܾ͢Δඞཁ͕͋Γ·͢
    ίϯϑϦΫτ͸΋͏͍΍ͩ
    ೣ͸ղܾ͠ͳ͍

    View full-size slide

  105. ίϯϑϦΫτͨ͠ϑΝΠϧ͸ɺboth

    View full-size slide

  106. ίϯϑϦΫτΛमਖ਼ͯ͠ɺίϛοτ͠·͢
    ίϯϑϦΫτ͸΋͏͍΍ͩ
    b
    <<<<<<< HEAD
    ccc
    =======
    c
    >>>>>>> topic
    d
    b
    ccc
    d
    ίϯϑϦΫτղܾ࣌ʹɺίϯϑϦΫτղܾҎ্ͷ͜ͱΛͯ͠͸
    ͍͚·ͤΜ
    Ͳͷ਌ʹ΋ݱΕͳ͍มߋΛ͍ͯ͠ΔϚʔδΛevil

    View full-size slide

  107. Φϓγϣϯͳ͠ͷgit

    View full-size slide

  108. Ͳ͏͠Α͏΋ͳ͘ͳͬͨ
    ؒҧͬͯϒϥϯνΛফͯ͠͠·ͬͨ
    ద౰ʹreset

    View full-size slide

  109.  ㅤ ㅤ ㅤ

    View full-size slide

  110. גࣜձࣾϛΫγΟͰ΋
    ΄ͱΜͲͷ෦ॺ͕࢖͍ͬͯ·͢

    View full-size slide

  111. GitHubͷPull

    View full-size slide

  112. ྡͷਓͷGitHubͷϓϩδΣΫτΛϑΥʔΫ͠·͢
    ϑΥʔΫͨ͠ϦϙδτϦΛखݩʹΫϩʔϯ͠·͢
    ࡞ۀ༻ϒϥϯνΛ࡞੒͠·͢
    มߋΛՃ͑ͯίϛοτͯ͠ϓογϡ͠·͢
    GitHub͔ΒPull

    View full-size slide

  113. w (JU#PPL
    w ͜Θ͘ͳ͍(JU
    w (JUͷ࢓૊Έ
    ͖ͤ͜ͷٕज़೔ه
    w ݟ͑ͳ͍νΧϥʲ຋༁ʳ(JUΛϘτϜΞοϓ͔Βཧղ͢Δ
    w $PEF4DIPPM5SZ(JU
    ࢀߟจݙ
    ΈΜͳ΋ಡΜͰΈΑ͏ʂ

    View full-size slide