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

効果的にGitHubを使うために

 効果的にGitHubを使うために

GitHub Constellation Tokyo
https://githubuniverse.com/constellation/

Takafumi Ikeda

June 07, 2017
Tweet

More Decks by Takafumi Ikeda

Other Decks in Technology

Transcript

  1. # Where software is built # $ 3 TAKAFUMI IKEDA

    SOLUTIONS ENGINEER Who am I?
  2. How people build software % ڞ௨͢Δ՝୊ 5 • OrgΛ෼͚͗͢ɺϓϩδΣΫτຖɺ෦ॺຖʹαΠϩԽ͍ͯ͠Δ •

    CI·Ͱख͕ճΒͳ͍ɺϏϧυखॱ͕ҰఆͰͳ͍ • Pull RequestΛ͏·͘࢖͑ͳ͍ɺϚʔδʹۤ࿑͢Δ • νʔϜͷशख़౓ʹ͹Β͖͕ͭ͋Δ • Φʔϓϯʹ͍͕ͨ͠ɺಉ࣌ʹ҆શੑ΋୲อ͍ͨ͠
  3. How people build software % ຊ೔͸ 6 • Org/Teamͷਖ਼͍͠࢖͍͜ͳ͠ํ •

    GitHub FlowͷԠ༻ɺपลػೳͷ࢖͍ํ • ͦͷଞɺϑϩʔߏஙʹ໾ཱͭҙ֎ͱ஌ΒΕ͍ͯͳ͍ػೳͷ঺հ
  4. How people build software % OrganizationΛ෼͚͗͢Δ 10 • Α͋͘Δࣄྫ: •

    ෦ॺ͝ͱʹOrgΛ෼͚Δʢ૊৫ߏ଄ͱҰகͤ͞Α͏ͱ͢Δʣ • ϓϩδΣΫτ͕࢝·ΔͨͼʹOrgΛ෼͚Δ • 200Ҏ্ͷOrg͕͋Δྫ΋
  5. How people build software % OrgΛগͳ͘ɺTeamΛଟ͘ 12 • OrgΛͰ͖ΔݶΓগͳ͘͠ɺݟ௨͠ΛΑ͘ •

    TeamΛ࢖ͬͯݖݶ؅ཧΛࡉ͘ઃఆ͢Δ͜ͱ • LDAP Team SyncΛ͏·͘࢖͍ɺϝϯς޻਺Λ࡟ݮ
  6. How people build software % ಁ໌Խͷ༷ʑͳྫ 14 • ͢΂ͯΦʔϓϯ •

    GitHub.comΛ࢖ͬͨOSSӡӦ • ࣾ಺͸͢΂ͯΦʔϓϯɺࣾ֎ʹ͸Ϋϩʔζ • GitHub.com Business Plan Hosted • GHEʹͯPublic Modeӡ༻ • ࣾһʹ͸Φʔϓϯʹɺύʔτφʔʹ͸੍ݶΛೖΕ͍ͨ • ز͔ͭͷύλʔϯ
  7. How people build software % GitHubͰͰ͖Δݖݶ؅ཧ 15 • GHEͷPublic/Private Mode

    • GHEͷΈɺΠϯελϯεશମͷՄࢹੑΛઃఆՄೳ
  8. How people build software % GitHubͰͰ͖Δݖݶ؅ཧ 16 • OrgͷDefault Permission

    • ϝϯόʔͷσϑΥϧτݖݶʹ͍ͭͯ4ͭͷҟͳΔઃఆ͕Մೳ
  9. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶ 17 • Α͋͘Δχʔζ •

    ࣾһͱύʔτφʔͰݖݶΛ෼͚͍ͨ • ύʔτφʔʹ͸ಛఆͷϦϙδτϦҎ֎͸Ұ੾Ӿཡ͢Βڐͨ͘͠ͳ͍
  10. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̍ʣ 18 • OrgΛ෼͚Δ •

    OrgΛ෼͚ɺશϦϙδτϦΛPrivateʹ͢Δ • ࣾһͱύʔτφʔͰ࡞Δ΋ͷɺݟΔ΋ͷ͕׬શʹผͷ৔߹ʹ༗ޮ • ྆ऀͷίϥϘϨʔγϣϯΛॏࢹ͠ͳ͍έʔε
  11. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̎ʣ 19 • ίϥϘϨʔλΛ͏·͘׆༻͢Δ •

    ࣾһ͚ͩͷOrgΛ࡞ΓɺύʔτφʔΛೖΕͳ͍ • ύʔτφʔͷڠྗ͕ඞཁͳϦϙδτϦʹରͯ͠͸ɺݸผʹίϥϘϨʔ λͱͯ͠௥Ճ
  12. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̏ʣ 20 • OrgͷσϑΥϧτઃఆΛNoneʹ͢Δ •

    ࣾһ΋ύʔτφʔ΋ಉ͡Orgʹॴଐ͠ɺTeamͰ෼͚ΔΠϝʔδ • σϑΥϧτͰ͸Ұ੾PrivateϦϙδτϦΛݟΔ͜ͱ͕Ͱ͖ͳ͘ͳΔ • ύʔτφʔTeamΛݸผʹϦϙδτϦʹ௥Ճ͢Δ͜ͱͰݖݶ؅ཧ • ͨͩ͠ɺࣾһTeam΋ݸผʹ௥Ճ͢Δඞཁ͋Γɺগ͠൥ࡶ
  13. How people build software % Org/Team ·ͱΊ 21 • OrgΛগͳ͘ɺTeamΛଟ͘

    • @mention͸OrgΛ·ͨ͛ͳ͍ • OrgͷDefault Permission, Private ModeΛ࢖͍͜ͳ͢ • Outside Collaborator͸֎෦ύʔτʔφʔʹ࠷ద
  14. How people build software % Org/Team Tips 22 • TeamΛ૊৫ߏ଄ͱҰகͤ͞Δඞཁ͸ͳ͍

    • Java Specialists, Security, SQL, Managers, Designers, … • ઐ໳ੑ΍ؔ৺ࣄͰ౎౓άϧʔϐϯά͢Δ͜ͱ΋େม༗ޮ • See also: https://github.com/blog/2316-organize-your-experts-with-ad-hoc-teams
  15. How people build software % Org/Team Tips 23 • OrgΛू໿͢Δͱ

    • ϦϙδτϦͷ਺͕๲େʹͳΓ୳͢ͷ͕େมʁ
  16. How people build software % Org/Team Tips 24 • Topics

    • ϦϙδτϦͷλά෇͚͕Մೳɺݕࡧʹ΋࢖͑Δ • GHE͸2.10ΑΓ
  17. How people build software % Org/Team Tips 25 • Pinned

    Repositories • ୅දతͳϦϙδτϦ͸ઌ಄ʹషΓ෇͚͓͚ͯΔ
  18. How people build software % Α͋͘Δޡղ 41 • ϚʔδલʹσϓϩΠͳΜͯͰ͖ͳ͍͔Βҧ͏ϑϩʔʹ •

    GitHub Flow͸Web։ൃҎ֎ʹ͸࢖͑ͳ͍ • Git-Flow͕େن໛։ൃʹ͸޲͍͍ͯΔ
  19. How people build software % ϙΠϯτ 42 • ੜଘظؒͷ௕͍ϒϥϯνΛݮΒ͢͜ͱ •

    ཧ૝తʹ͸MasterҰຊͷΈ • Pull Requestϒϥϯν͸Ͱ͖Δ͚ͩૣ͘Ϛʔδ͢Δ • ҰͭҰͭͷมߋΛখ͘͞ • ϑΟʔνϟʔϑϥάͳͲ΋༗ޮʹ࢖͏ • Ϛʔδͨ͠Β͙͢ʹফ͢
  20. How people build software % λάͰ୅ସͰ͖ͳ͍͔ߟ͑ͯΈΔ 45 • ग़ՙόʔδϣϯɺίʔυϑϦʔζɺQAظ͕ؒඞཁͰ͋Ε͹ɺλάͰ୅ସͰ͖ͳ͍͔ •

    ඞཁ͕ੜͨ͡ͱ͖ͷΈϒϥϯνΛ࡞ΓɺऴΘͬͨΒফ͢ • ͜͜Ͱ΋ෳ਺όʔδϣϯ͕ಉ࣌ʹଘࡏ͢ΔͱෳࡶʹͳΔ͜ͱʹ஫ҙ v0.1.pre v0.1.pre.2 v0.1 v0.2.pre
  21. How people build software % GitHub Flow·ͱΊ 46 • GitHub

    Flow͸Ԡ༻Մೳ • ௕ظؒϒϥϯνͷ਺ΛͰ͖Δ͚ͩݮΒ͢ • λάΛ༗ޮ׆༻͢Δ
  22. How people build software % ศརͳػೳ 48 • Revert •

    Blame • Update Branch • Conflictͷղফ • ֤छϚʔδΦϓγϣϯ • ForkઌͷฤूڐՄ • etc
  23. how software is built % Revert 50 ೔ຊޠԽͨ͠ ςετ΋मਖ਼ ؔ܎ͷͳ͍मਖ਼

    REVERT Pull Request Pull Request͕ؔ࿈͢ΔίϛοτΛ஌͍ͬͯΔ
  24. How people build software % Protected Branches 54 • ༷ʑͳܗͰϒϥϯνΛอޢ

    • Delete, Push -f ͷېࢭ • ϨϏϡʔͷඞਢԽ • CIͳͲεςʔλενΣοΫ • ϚʔδՄೳͳਓ/TeamΛ੍ݶ
  25. How people build software % ҙ֎ͱ஌ΒΕ͍ͯͳ͍ػೳ܈ 56 • Release •

    Pre-Receive Hooks (GHE Only) • ͞·͟·ͳRenderingΦϓγϣϯ • SVN Bridge • git-import
  26. How people build software % Pre Receive Hooks 58 •

    GHE only͕ͩɺαʔόαΠυͷPre Receive Hook͕ॻ͚Δ • ৘ใ࿙͍͑νΣοΫɺPGP伴ͷνΣοΫͳͲͳͲʹ • ηΩϡϦςΟ্ͷݒ೦Λ༧๷తʹνΣοΫͰ͖Δ • ࣗ෼ͷ޷͖ͳϥΠϒϥϦɺݴޠΛΠϯετʔϧՄೳ • Chroot, DockerରԠ • جຊతʹ͸ͳΜͰ΋Ͱ͖ΔͷͰӡ༻ʹ͸஫ҙ͕ඞཁ
  27. How people build software % ༷ʑͳϨϯμϦϯά 59 • ը૾ •

    PDF • GeoJson • Jupyternootbook • STL • CSV/TSV • Markdown • etc
  28. How people build software % ·ͱΊ 64 • Org/TeamΛ஌Γɺ্खʹ࢖͍͜ͳͦ͏ •

    GitHub Flow͸༷ʑͳܗͰԠ༻Մೳ • Protected BranchesΛ࢝ΊɺػೳΛ஌Γɺ։ൃϑϩʔΛߏங͠Α͏ • ࢼߦࡨޡ͠ɺࣗ͝਎ʹͱͬͯͷ࠷దղΛݟग़ͦ͏