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 Slide

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

    View Slide

  3. Version_20150707

    View Slide

  4. Version_20150707

    View Slide

  5. Version_20150707

    View Slide

  6. Version_20150707
    ߺ㮆ฎ碝粚牫

    View Slide

  7. View Slide

  8. 硬ԧՋ讕牫

    View Slide

  9. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  15. 犥 傶ֺ

    View Slide

  16. GIT ጱ瞲犤

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  35. 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 Slide

  36. 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 Slide

  37. 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 Slide

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

    View Slide

  39. git checkout [. | hash]

    View Slide

  40. git add -p

    View Slide

  41. Ջ讕ฎ hunk ?

    View Slide

  42. Ջ讕ฎ hunk ?

    View Slide

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

    View Slide

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

    View Slide

  45. git 咳㬙ک螐ᒒ

    View Slide

  46. git 咳㬙ک螐ᒒ

    View Slide

  47. git 咳㬙ک螐ᒒ

    View Slide

  48. git 咳㬙ک螐ᒒ

    View Slide

  49. git remote add origin [email protected]
    Local
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View Slide

  50. git remote add origin [email protected]
    Local Remote
    Remote Repo/
    Master
    Remote Repo/
    Master
    Local Repo/
    Master
    Staging
    Area
    Workspace

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  54. 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 Slide

  55. Q & A

    View Slide