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

Laradebut #02 版本控制管理與操作 以 git 為例

Laradebut #02 版本控制管理與操作 以 git 為例

本簡報以 GIT 為例,講述版本管理 ( Version Control ) 的觀念與 GIT 背後的原理。 相關錄影於:https://www.youtube.com/watch?v=cX9IbYgyeqc

mouson(墨嗓)

July 14, 2016
Tweet

More Decks by mouson(墨嗓)

Other Decks in Technology

Transcript

  1. 粚๜矒ګ薪盢膏砺֢
    犥 傶ֺ
    Mouson & Duncan @ Laradubet #02
    2016.07.14

    View full-size slide

  2. Ջ讕ฎ̿粚๜ᓕቘ̀牫

    View full-size slide

  3. Version_20150707

    View full-size slide

  4. Version_20150707

    View full-size slide

  5. Version_20150707

    View full-size slide

  6. Version_20150707
    ߺ㮆ฎ碝粚牫

    View full-size slide

  7. 硬ԧՋ讕牫

    View full-size slide

  8. ಅ犥粚๜䛑扗
    ̿ெ讕ᓕቘ̀牫

    View full-size slide

  9. 粚๜ᓕቘ䛑扗懿袅 4W
    • What 硬ԧՋ讕牫
    • Why 傶Ջ讕ᘒ硬牫
    • Who 抑硬ጱ牫
    • When Ջ讕碻狡硬牫

    View full-size slide

  10. 磪ߺ犚
    ̿粚๜ᓕቘ̀ૡٍ牫

    View full-size slide

  11. ̿粚๜ᓕቘ̀ૡٍ觊ࣳ

    View full-size slide

  12. 獤碂ୗ 膏 褸Ӿୗ
    • 褸Ӿୗ EX: Subversion牏CVS
    • ಅ磪砺֢᮷ࣁӾ瓷牧䷱磪翕᪠蝫矑㳷
    篷ဩਂ玲
    • 獤碂ୗ EX: Mercurial SCM牏GIT
    • ๜瑿疰磪ਠ碉懿袅牧䷱磪翕᪠犖ݢ犥
    砺֢

    View full-size slide

  13. GIT ጱ瞲犤

    View full-size slide

  14. git 玟ऒ獤觊
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  15. git init - 虻碘䓚ڡত
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git init

    View full-size slide

  16. git init - 虻碘䓚ڡত
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git init

    View full-size slide

  17. git status
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git status

    View full-size slide

  18. git status
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git status

    View full-size slide

  19. git status
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git status

    View full-size slide

  20. GIT .gitignore 䲆礯
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  21. GIT .gitignore 䲆礯
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  22. GIT .gitignore 䲆礯
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  23. git add [folder/file] 碝ी
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git add

    View full-size slide

  24. git add [folder/file] 碝ी
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git add

    View full-size slide

  25. git commit
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git add git commit

    View full-size slide

  26. git commit
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git add git commit

    View full-size slide

  27. git commit --amend
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git add git commit

    View full-size slide

  28. git commit
    • git commit --amend
    • git commit --amend --author=“Name

    • git config user.name “Mou Chen”
    • git config user.email [email protected]
    • git config --global user.name “Mou Chen”

    View full-size slide

  29. git config alias
    1. git config alias.co checkout
    • git co 缛ෝ git checkout
    2. git config alias.ci commit
    • git ci 缛ෝ git commit
    3. …

    View full-size slide

  30. git ૡٍ
    • ZSH (http://www.zsh.org/)
    • oh-my-zsh (http://ohmyz.sh/)
    • powerline (https://github.com/powerline/
    powerline)
    • git autocomplete (https://github.com/
    robbyrussell/oh-my-zsh/tree/master/
    plugins/git )

    View full-size slide

  31. git reset […] ᯿ᗝ
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    —soft HEAD^
    —mixed HEAD^
    git reset —hard HEAD^

    View full-size slide

  32. git checkout [. | hash]

    View full-size slide

  33. Ջ讕ฎ hunk ?

    View full-size slide

  34. Ջ讕ฎ hunk ?

    View full-size slide

  35. git log
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git log

    View full-size slide

  36. git log
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git log

    View full-size slide

  37. git 咳㬙ک螐ᒒ

    View full-size slide

  38. git 咳㬙ک螐ᒒ

    View full-size slide

  39. git 咳㬙ک螐ᒒ

    View full-size slide

  40. git 咳㬙ک螐ᒒ

    View full-size slide

  41. git remote add origin git@git..
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  42. git remote add origin git@git..
    Local Remote
    Remote Repo/
    Master
    Remote Repo/
    Master
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View full-size slide

  43. git push -u origin master
    Local Remote
    Remote Repo/
    Master
    Remote Repo/
    Master
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git push

    View full-size slide

  44. git fetch
    Local Remote
    Remote Repo/
    Master
    Remote Repo/
    Master
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git push
    git fetch

    View full-size slide

  45. git merge
    Local Remote
    Remote Repo/
    Master
    Remote Repo/
    Master
    Local Repo/
    Master
    Staging
    Area
    Workspace
    git push
    git merge git fetch

    View full-size slide

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

    View full-size slide