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

The 7 Habits of Git

The 7 Habits of Git

Git 7つの心得
http://atnd.org/events/42085

Sotaro Karasawa

August 27, 2013
Tweet

More Decks by Sotaro Karasawa

Other Decks in Technology

Transcript

  1. Crocos, Inc. Sotaro Karasawa @sotarok http://facebook.com/sotarok (JUͭͷ৺ߏ͑ #get_great_git @ (FU(SFBU(JUCZ2JJUB

  2. ࣗݾ঺հ 4PUBSP,BSBTBXB!TPUBSPL ฑ୔૱ଠ࿠ IUUQRJJUBDPNTPUBSPL גࣜձࣾΫϩίε$SPDPT*OD 1)1 (JU 3FE#VMM

  3.  (3&&Ͱ47/ˠ(JUҠߦͷϓϩδΣΫτɻ։ൃϑϩʔΛ جຊ่ͣ͞(JUͷྑ͍ॴΛ׆͔ͤΔϑϩʔ࡞Γ  HJUEBJMZϦϦʔε  $SPDPTͰ(*5-"#ಋೖ 1VMM3FRVFTUϕʔεͷ։ൃϑϩʔ΁  (JU)VC

    1SJWBUF ʹҠߦ (JUʹؔͯ͠Կ͔͍͏͜ͱ͕͋Δͱ͢Ε͹
  4. ࠓ೔࿩͢͜ͱʮ৺ߏ͑ʯ ର৅ऀ (JUॳʙதڃऀ 1VMM3FRVFTUͦΖͦΖ͔ͳͷਓ

  5. ଉΛٵ͏Α͏ʹHJUTUBUVT

  6. -JOVYͰ ͳΜ͔MTͬͯଧͪ·͢ΑͶ Ջͳ࣌

  7. ͦͷؾ࣋Ͱ HJUTUBUVT

  8. ͋ͱEJGG HJUEJGG HJUEJGGDBDIFE

  9. ͱʹ͔͘DPNNJUલʹ HJUEJGGDBDIFE

  10. HJUDPNNJUB࢖͏ͳ ͻͱͭͻͱͭ BEE͢Δͱྑ͍Ͱ͢ 47/͔Βདྷͨਓ͕ Α͘΍ͬͯΔ͖͕͢Δ

  11. ͳΜͳΒBMJBTʹ BMJBTHTUHJUTUBUVT

  12. ଉΛు͘Α͏ʹHJUCSBODI

  13. 1VMM1VTI.FSHF3FCBTF ͢΂ͯͷૢ࡞Ͱ CSBODIΛҙࣝ͠·͠ΐ͏ʂ

  14. Α͋͘Δ(JUࣄނτοϓ ʮ͍͢·ͤΜɺ ɹҧ͏ϒϥϯνʹQVTIͪ͠Ό ͍·ͨ͠ʯ

  15. ͳΜͳΒBMJBTʹ BMJBTHCHJUCSBODIB

  16. ͪͳΈʹ ϓϩϯϓτʹදࣔͤͯ͞Δ

  17. ͪͳΈʹ ϓϩϯϓτʹදࣔͤͯ͞Δ τϥϒΔਓ͸ ͍͍ͩͨݟͯ·ͤΜʂ ༉அې෺ʂ

  18. NFSHF SFCBTFΛཧղ͢Δ

  19. େࡶ೺ʹݴͬͯ Git ษڧձ@ສ༿ #3 ʹߦ͖ͬͯͨ http://gom.hatenablog.com/entry/20090522/1243011416 ૬खͷมߋΛଚॏ͠·͠ΐ͏ NFSHFࣗ෼͕ओମɻࣗ෼ͷΛݩʹ૬खͷมߋΛద༻͢Δ SFCBTF૬ख͕ओମɻ૬खͷΛݩʹࣗ෼ͷมߋΛద༻͢Δ

  20. NFSHFࣗ෼͕ओମ SFCBTF૬ख͕ओମ

  21. NFSHF ࣗ෼ ૬ख

  22. NFSHF ࣗ෼ ૬ख ࣗ෼ͷมߋʹ૬ख ͷมߋΛ͔ͿͤΔ Πϝʔδ

  23. SFCBTF ࣗ෼ ૬ख

  24. SFCBTF Πϝʔδ ࣗ෼ ૬ख

  25. SFCBTF Πϝʔδ ࣗ෼ ૬ख

  26. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख ΠϚίί

  27. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख ΠϚίί

  28. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख ΠϚίί

  29. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख ΠϚίί

  30. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख ΠϚίί

  31. SFCBTF Πϝʔδߏஙͷ༷ࢠ ࣗ෼ ૬ख

  32. SFNPUFϒϥϯν໊Λলུ͠ͳ͍

  33. ૢ࡞͸໌ࣔతʹ HJUQVTIPSJHJOGFBUVSFYYY

  34. ͻͱͭ΋͔ܽͤ·ͤΜ HJUTUBUVT HJUEJGG HJUBEE HJUEJGGDBDIFE HJUDPNNJU HJUQVTIPSJHJOGFBUVSFYYY

  35. มߋͪ͠ΌμϝͳιϨ

  36. ެ։ࡁΈͷ ྺ࢙Λ มߋͯ͠͸ ͍͚ͳ͍

  37. SFCBTF SFCBTFͱ͸ ྺ࢙Λ࠶ߏங͢Δ͜ͱ

  38. ެ։ࡁΈͱ͸ جຊతʹ͸ HJUQVTI ͨ͠΋ͷ ͞Εͨ΋ͷ

  39. ͦΕ͕Θ͔ͬͯͳ͍ͱ ଞਓ͕QVTIͨ͠΋ͷΛ DMPOF DIFDLPVU ͖ͯͯ͠ Կ͔͠ΒͷλΠϛϯάͰ HJUQVMMSFCBTF /(

  40. ·ͨ͸ ࣗ෼͕QVTIͨ͠΋ͷ ଞͷਓ͕DIFDLPVUͯ͠Δͷʹ HJUSFCBTF HJUQVTIPSJHJOGGFBUVSFYYYY

  41. SFCBTF͸ͲΜͲΜͯ͠ྑ͍͚Ͳ ศར͔ͩΒͶ commit ͷཻ౓ΛͶ ៉ྷʹͨ͠ΓͶ ͨͩ͠ɺଞͷਓͷ͜ͱΛߟ͑Δ ͜ͷ rebase ͷҙຯΛߟ͑Δ

  42. ௕͍࡞ۀ͸খϚϝʹSFCBTF

  43. DPOqJDU͸খ͍͞΄͏͕ྑ͍ ϝΠϯͱͳΔ։ൃϒϥϯν ೔ʑ rebase ͔͚·͠ΐ͏ Ϳ͔ͭΔͳΒখ͍͞͏ͪʹʂ

  44. ͖ͨͩͬ͠͞ͷ࿩ ଞਓ͕QVTIͨ͠΋ͷΛ DMPOF DIFDLPVU ͖ͯͯ͠ Կ͔͠ΒͷλΠϛϯάͰ HJUQVMMSFCBTF /(

  45. ·ͨ͸ merge ...

  46. (JU)VCͱ1VMM3FRVFTU࢖͏

  47. Git Λಋೖ͢Δ͜ͱ ʺϞμϯͰΠέͯΔ։ൃ

  48. Git ͷಋೖ ͱ͸ ։ൃϑϩʔɾۀ຿ϑϩʔͷ ࠶ߏஙͦͷ΋ͷ

  49. (JU࢖ͬͯΔͷʹ ϒϥϯν͸ͭͱ͔

  50. (JU)VC͕ͦ͜ (JUΛ࢖ͬͨ։ൃʹ͓ ͚Δ࠷ྑͷπʔϧͰ ͋Δʂ ଟ෼

  51. ౰࣌(*5-"#࢖ͬͯ·͚ͨ͠ͲͶฐࣾ όʔδϣϯ͕͋Γ·ͬͯ͘·͢Ͷ ΍ΊͯΑ͔ͬͨ

  52. 1VMM3FRVFTU ʮPull Requestʯ ͸Φʔϓϯιʔ εʹݶΒͣ࢖͑Δ༏Εͨ։ൃϑ ϩʔͩ http://d.hatena.ne.jp/sotarok/20120219/1329581585

  53. 1VMM3FRVFTU Ͱ͖Δ͚ͩ୯ҐΛখ͘͞

  54. 1VMM3FRVFTU େ͖͘ͳΓ͗͢Δ৔߹ τϐοΫϒϥϯν͔Β αϒτϐοΫͰϒϥϯνΛ੾Δ

  55. ࠷ۙ͋ͬͨେن໛։ൃ αϒτϐοΫϒϥϯν 33 branch merges 165 commits

  56. ࠷ޙʹͦͷଞͷ࿩୊

  57. 1VMM3FRVFTUຖͷ࣮ߦ؀ڥ Production = marketing.crocos.jp Pull Request #123 = pr123.dev.marketing.crocos.jp

  58. 1VMM3FRVFTUຖͷ࣮ߦ؀ڥ nginxͰ ... server_name ~^pr([^.]+).dev.([^.]+) ɹɹɹɹ\.marketing\.crocos\.jp$; set $pr_name $1; set

    $app_name $2;
  59. (JU'MPXY(JU)VC'MPX @ship @battleship

  60. ଟ෼ࢀߟʹͳΔࢿྉ

  61. ා͘ͳ͍(JU IUUQLPUBTIBUFOBCMPHKQFOUSZ  (JU#PPL IUUQHJUTDNDPNCPPLKB

  62. -FBSOJOH(JU#SBODIJOH IUUQLTXEDDMFBSO(JU#SBODIJOHKB "TVDDFTTGVM(JUCSBODIJOHNPEFMΛ ຋༁͠·ͨ͠ IUUQLFJKJOTPOZBCBOCMPHTQPUKQ TVDDFTTGVMHJUCSBODIJOHNPEFMIUNM

  63. (JUΛऔΓר͘؀ڥɺ ։ൃϑϩʔͷ࿩ ૬ஊ૭ޱΛઃ͚·ͨ͠

  64. SFDSVJU!DSPDPTDPKQ

  65. None