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

Laradebut #03 從 git 入門到團隊合作開發

Laradebut #03 從 git 入門到團隊合作開發

本簡報介紹版本管理 ( Version Control ) git 的基礎指令,一直到基本的團隊合作開發的展示,講解的部份以動畫的方式呈現,希望降低 git 指令入門的門檻。

發表於:Laradebut #3 於 urAd

內容所提到的 github 連結置於:
https://github.com/mouson/laradebut3-demo

錄影紀實:
https://www.youtube.com/watch?v=sEloF3SzGI8

mouson(墨嗓)

August 18, 2016
Tweet

More Decks by mouson(墨嗓)

Other Decks in Technology

Transcript

  1. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add git commit Hunk A
  2. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add git commit Hunk A HASH A
  3. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace Hunk A HASH A Hunk B Hunk C Hunk D
  4. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add Hunk A HASH A Hunk D Hunk B Hunk C
  5. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add git commit Hunk A HASH A Hunk D Hunk B Hunk C
  6. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add git commit Hunk A HASH A Hunk D Hunk B Hunk C HASH B
  7. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace Hunk A HASH A Hunk D Hunk B Hunk C HASH B
  8. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add Hunk A HASH A Hunk B Hunk C HASH B Hunk D
  9. git add & commit 奲ݳದ Local Local Repo/ Master Staging

    Area Workspace git add git commit Hunk A HASH A Hunk B Hunk C HASH B Hunk D HASH C
  10. git HEAD Local Local Repo/ Master Staging Area Workspace Hunk

    A HASH A Hunk B Hunk C HASH B Hunk D HASH C
  11. git HEAD Local Local Repo/ Master Staging Area Workspace Hunk

    A HASH A Hunk B Hunk C HASH B Hunk D HASH C HEAD
  12. git HEAD Local Local Repo/ Master Staging Area Workspace Hunk

    A HASH A Hunk B Hunk C HASH B Hunk D HASH C HEAD HEAD^
  13. git HEAD Local Local Repo/ Master Staging Area Workspace Hunk

    A HASH A Hunk B Hunk C HASH B Hunk D HASH C HEAD HEAD^ HEAD^^
  14. git reset --mixed ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B
  15. git reset --mixed ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace —mixed HEAD^ Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B
  16. git reset --mixed ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace —mixed HEAD^ Hunk D Hunk A HASH A Hunk B Hunk C HASH B
  17. git reset --soft ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B
  18. git reset --soft ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B —soft HEAD^
  19. git reset --soft ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk A HASH A Hunk B Hunk C HASH B —soft HEAD^ Hunk D
  20. git reset --hard ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B
  21. git reset --hard ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D HASH C Hunk A HASH A Hunk B Hunk C HASH B git reset —hard HEAD^
  22. git reset --hard ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk D Hunk A HASH A Hunk B Hunk C HASH B git reset —hard HEAD^
  23. git reset --hard ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace Hunk A HASH A Hunk B Hunk C HASH B git reset —hard HEAD^
  24. git reset […] ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace —mixed HEAD^ git reset —hard HEAD^ —soft HEAD^
  25. git remote add origin git@git.. Local Remote Remote Repo/ Master

    Remote Repo/ Master Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B
  26. git push -u origin master Local Remote Remote Repo/ Master

    Remote Repo/ Master Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B
  27. git push -u origin master Local Remote Remote Repo/ Master

    Remote Repo/ Master Local Repo/ Master Staging Area Workspace git push HASH C HASH A HASH B HASH C HASH A HASH B
  28. git push -u origin master Local Remote Remote Repo/ Master

    Remote Repo/ Master Local Repo/ Master Staging Area Workspace git push HASH C HASH A HASH B HASH C HASH A HASH B
  29. git push -u origin master Local Remote Remote Repo/ Master

    Remote Repo/ Master Local Repo/ Master Staging Area Workspace git push HASH C HASH A HASH B HASH C HASH A HASH B HASH C HASH A HASH B
  30. git fetch Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B HASH C HASH A HASH B
  31. git fetch Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B HASH D HASH C HASH A HASH B HASH D
  32. git fetch Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B git fetch HASH D HASH C HASH A HASH B HASH D
  33. git fetch Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B git fetch HASH C HASH A HASH B HASH D HASH D
  34. git branch Local Remote Local Repo/ Master Staging Area Workspace

    HASH C HASH A HASH B Remote Repo/ Master Remote Repo/ Master HASH C HASH A HASH B HASH C HASH A HASH B HASH D HASH D
  35. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop
  36. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B
  37. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B
  38. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B
  39. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B A B C
  40. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B A B C Master (HEAD)
  41. git branch Local Remote Local Repo/ Master Local Repo/ Develop

    HASH C HASH A HASH B git branch develop HASH C HASH A HASH B A B C Master Develop (HEAD)
  42. Local base git rebase develop A B C Develop Master

    (HEAD) D E F F' ᯿碝懯ᓒ癩吖
  43. Local base git rebase develop A B C Develop Master

    (HEAD) D E F F' ᯿碝懯ᓒ癩吖
  44. Local base git rebase develop A B C Develop Master

    (HEAD) D E F F' ᯿碝懯ᓒ癩吖
  45. git merge Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B git fetch HASH D HASH C HASH A HASH B HASH D HASH D HASH D
  46. git merge Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace HASH C HASH A HASH B HASH C HASH A HASH B git fetch HASH D HASH C HASH A HASH B HASH D HASH D git merge HASH D HASH D
  47. git pull Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace git fetch git merge
  48. git pull Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace git fetch git merge git pull
  49. git pull --rebase Local Remote Remote Repo/ Master Remote Repo/

    Master Local Repo/ Master Staging Area Workspace git fetch git rebase
  50. git pull --rebase Local Remote Remote Repo/ Master Remote Repo/

    Master Local Repo/ Master Staging Area Workspace git fetch git rebase git pull --rebase
  51. ̿碍ڜ懯ᓒ̀䌕礯Օ奧 • 揲࿄羷碍 (Fibonacci Sequence) • P(0)=0, P(1)=1, P(N)=P(N-1)+P(N-2) •

    ૬᮷苭羷碍 (Padovan Sequence) • P(0)=P(1)=P(2)= 1, P(N)=P(N-2)+P(N-3)
  52. git clone Local Remote Remote Repo/ Master Remote Repo/ Master

    Local Repo/ Master Staging Area Workspace git clone