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

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

Ab628671841774343b1020f22f712069?s=47 mouson
July 14, 2016

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

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

Ab628671841774343b1020f22f712069?s=128

mouson

July 14, 2016
Tweet

Transcript

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

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

  3. Version_20150707

  4. Version_20150707

  5. Version_20150707

  6. Version_20150707 ߺ㮆ฎ碝粚牫

  7. None
  8. 硬ԧՋ讕牫

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

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

    抑硬ጱ牫 • When Ջ讕碻狡硬牫
  12. 磪ߺ犚 ̿粚๜ᓕቘ̀ૡٍ牫

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

  14. 獤碂ୗ 膏 褸Ӿୗ • 褸Ӿୗ EX: Subversion牏CVS • ಅ磪砺֢᮷ࣁӾ瓷牧䷱磪翕᪠蝫矑㳷 篷ဩਂ玲

    • 獤碂ୗ EX: Mercurial SCM牏GIT • ๜瑿疰磪ਠ碉懿袅牧䷱磪翕᪠犖ݢ犥 砺֢
  15. 犥 傶ֺ

  16. GIT ጱ瞲犤

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

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

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

    Workspace git init
  20. None
  21. None
  22. None
  23. None
  24. git status Local Local Repo/ Master Staging Area Workspace git

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

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

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

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

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

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

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

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

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

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

    git add git commit
  35. git commit • git commit --amend • git commit --amend

    --author=“Name <email@addr.com>” • git config user.name “Mou Chen” • git config user.email email@addr.com • git config --global user.name “Mou Chen”
  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. …
  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 )
  38. git reset […] ᯿ᗝ Local Local Repo/ Master Staging Area

    Workspace —soft HEAD^ —mixed HEAD^ git reset —hard HEAD^
  39. git checkout [. | hash]

  40. git add -p

  41. Ջ讕ฎ hunk ?

  42. Ջ讕ฎ hunk ?

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

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

    log
  45. git 咳㬙ک螐ᒒ

  46. git 咳㬙ک螐ᒒ

  47. git 咳㬙ک螐ᒒ

  48. git 咳㬙ک螐ᒒ

  49. git remote add origin git@git.. Local Local Repo/ Master Staging

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

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

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

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

    Local Repo/ Master Staging Area Workspace git push git merge git fetch
  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
  55. Q & A