$30 off During Our Annual Pro Sale. View Details »

git-daily: A tool supports a daily workflow with remote

git-daily: A tool supports a daily workflow with remote

Python Developers Festa 2011.10.

Sotaro Karasawa

October 15, 2011
Tweet

More Decks by Sotaro Karasawa

Other Decks in Technology

Transcript

  1. git-daily #pyfes @sotarok http://strk.jp/ A tool supports a daily workflow

    with remote
  2. ࣗݾ঺հ

  3. sotarok ͦ͏ͨΖ͏ (͚ʔ) Crocos, Inc. PHP Git Perfume capsule Red

    Bull (Congratulation on world champion!)
  4. WEB+DB PRESS Vol.65 PHPಛू ୈ̍ষ ॻ͖·ͨ͠ 10/22 ൃച એ఻Ͱͨ͠ɻ#pyfes ͚ͩͲ...

  5. Git ?

  6. Git ʹΑΔ։ൃ

  7. Git ≠ ศརͳSubversion

  8. GitʹΑΔ։ൃ: - Subversionʹ͓͚Δbranch͸? - (e.g. trunk, tags ...) - ϒϥϯνͷӡ༻

    - ϦϦʔεϑϩʔ
  9. A successful Git branching model http://nvie.com/posts/a-successful-git-branching-model/

  10. gitflow ͗ͬͱ;Ζʔ

  11. gitflow?

  12. gitflow: ɹϒϥϯνӡ༻Ϟσϧͷ ɹϕετϓϥΫςΟε ɹͷͨΊͷ ɹGit Command Wrapper

  13. IUUQOWJFDPNQPTUTBTVDDFTTGVMHJUCSBODIJOHNPEFM

  14. ϒϥϯνӡ༻Ϟσϧ master: ϦϦʔε͞Ε͍ͯΔ࠷৽ͷιʔείʔυ develop: ։ൃ༻ϒϥϯν feature/xxx: ಛఆػೳxxx༻ϒϥϯν release/yyy: yyyϦϦʔε༻ϒϥϯν hotfix/zzz:

    masterϒϥϯνͷۓٸमਖ਼༻ϒϥϯν
  15. $ git flow feature start hoge $ git checkout -b

    feature/hoge
  16. $ git flow feature finish hoge $ git checkout develop

    $ git merge --no-ff feature/hoge $ git branch -d fearture/hoge
  17. $ git flow release start 1.0 $ git checkout -b

    release/1.0
  18. $ git flow release finish hoge $ git checkout master

    $ git merge --no-ff release/1.0 $ git tag -a 1.0 $ git checkout develop $ git merge --no-ff release/1.0 $ git branch -d release/1.0
  19. gitflow: - ϥΠϒϥϦ(ͷΑ͏ͳ΋ͷ) ͷ։ൃʹ޲͍͍ͯΔ - release ࣌ɺtag ͕͚ͭΒΕΔ - remote

    ͱͷ࿈ܞ࡞ۀ͸΄΅ߟྀ͞Ε͍ͯͳ͍ Web ։ൃ Y gitflow = ϕετ?
  20. Web։ൃͱ͔νʔϜ։ൃͱ͔: - ϥΠϒϥϦ(ͷΑ͏ͳ΋ͷ)ΑΓ΋සൃ͢ΔϦϦʔε - ؾָʹϒϥϯν੾Γ͍ͨɺϦϦʔε͍ͨ͠ - remote ͱͷ࿈ܞ͕جຊ - Git

    ͚ͩͲ - தԝूݖαʔό͕͋ͬͨΓɻ͋ΔΑͶɻ - e.g. GitHub, gitosis
  21. ॏཁͳͷ͸ gitflow ͱ͍͏πʔϧͰ͸ͳ͍

  22. A successful Git branching model http://nvie.com/posts/a-successful-git-branching-model/

  23. IUUQOWJFDPNQPTUTBTVDDFTTGVMHJUCSBODIJOHNPEFM

  24. ϒϥϯνӡ༻Ϟσϧ ࣗ༝͗͢ΔGitʹ ϒϥϯνͷʮӡ༻ϧʔϧʯΛͭ͘Γ ݱ࣮తͰ߹ཧతͳ GitΛ༻͍ͨ ։ൃͷϧʔϧΛఆΊΔ΋ͷ ͞·͟·ͳελΠϧͷ ։ൃʹԠ༻͕Մೳ

  25. Git͕ࣗ༝͗͢Δྫ1 $ git pull origin develop local ͷ master ϒϥϯν΁

    remote ͷ develop ϒϥϯν͔Β pull
  26. Git͕ࣗ༝͗͢Δྫ2 $ git push origin master develop ϒϥϯν͔Β remote ͷ

    master ϒϥϯν΁ͷ push
  27. ൵ܶ͸ಥવ΍ͬͯ͘Δ DUSMS

  28. ؓ࿩ٳ୊

  29. git-daily

  30. / /git-daily

  31. git-daily: - gitflow ͷ branching model Λ࠾༻ - ස౓ͷߴ͍ϦϦʔε/೔ʑͷϦϦʔε -

    tag ͱ͔੾Βͳ͍ - remote ͱͷ࿈ܞ - push/pull - remote branch ࡞੒/࡟আͷࣗಈԽ - release “sync”
  32. git daily init - master, develop ϒϥϯν໊ͷܾఆ - ඪ४Ͱར༻͢Δ remote

    ໊Λܾఆ - default: origin - ઃఆ͸ .git/config ʹ gitdaily ηΫγϣϯͰอଘ
  33. git daily release open - ϦϦʔεϒϥϯν: release/yyyymmdd-hhMM - ϒϥϯν໊͸೔෇͔Βࣗಈੜ੒ -

    open ޙʹ remote ʹ push
  34. git daily release sync - remote ͱ sync - remote

    ʹ open ͞Εͨ release branch ͕͋Γɺࣗ෼ ͷखݩʹແ͍৔߹ → औಘ͖ͯͯ͠ checkout - खݩʹ͋Δ → push / pull ͢Δ - remote ͷ release branch ͕ফ͑ͯͯखݩʹ͋Δ → खݩͷ΍ͭ࡟আ
  35. git daily release close - ϦϦʔεϒϥϯνΛ master ʹ merge -

    master ϒϥϯνͷ push - ϦϦʔεϒϥϯνΛ develop ʹ merge - ͪΌΜͱ pull ͔ͯ͠Β merge - develop ϒϥϯνͷ push - remote ͷϦϦʔεϒϥϯν࡟আ - local ͔Β΋࡟আ
  36. demo

  37. Git ͷ Wrapperπʔϧ: - Git͸ࣗ༝͗͢Δ - ձࣾͰ࢖͏ͳΒͦͷձࣾͰͷ։ൃελΠϧʹ͋Θ ͤͨ Wrapper πʔϧ͸ඞཁ

    - gitflow Λ͔ͭ͏΋Α͠ɺgit-dailyΛ͔ͭ͏΋Α ͠ɺࣗ࡞͢Δ΋Α͠ - git-xxxx ͱ͍͏࣮ߦϑΝΠϧΛ $PATH ʹஔ͚͹ git ͷαϒίϚϯυ࡞Ε·͢
  38. Wrapperπʔϧͷ໰୊఺: - Gitͷʮੜͷૢ࡞ʯ͕Ӆṭ͞ΕΔ - ໰୊͕ൃੜͨ͠ͱ͖ͷղܾํ๏ - CONFLICT - ͦ͏͸ݴͬͯ΋ Git

    ͷ஌ࣝ͸΋ͪΖΜɺඞཁ - Կ͔͋ͬͨͱ͖ʹͲ͔͜Β࢝ΊΕ͹ྑ͍ͷ? - gitflow ͷ৔߹: - CONFLICT Λղফͨ͠Β·ͨ git flow release finish hoge Λଧͯ͹ྑ͍ (ຊ౰?)
  39. git-daily: - ࣮͸ release ͔͠ରԠͯ͠ͳ͍ (͒ - hotfix ͸࣍ͷόʔδϣϯͰ -

    feature ΋ͦͷ͏ͪ - ਖ਼௚ feature ͸͋Μ·΍Δ͜ͱͳ͍͔Β gitflow Ͱ΋͍͍Ͱ͢ - ซ༻ՄೳͰ͢ - ·͋࡞Δ͚Ͳ - test ॻ͍ͯΔ
  40. git-daily: - ࢖͍͍ͨํ͕͍ͨΒͥͻͥͻ - Feedback ͍͚ͨͩΔͱخ͍͠Ͱ͢ - Pull Request ΋

    - Git ӡ༻ͷϕετϓϥΫςΟεڞ༗͠·͠ΐ͏
  41. git-daily: PHP ੡Ͱ͢ m9 - ΋͠࢖͍͍ͨͱࢥͬͨΒੋඇ - ͝ΊΜ PHP ੡ͳΜͩ

    Python ͩͱ ࢥͬͨ? PHP Ͱͨ͠
  42. None
  43. Question?