穿越時空的版本控制 Git

穿越時空的版本控制 Git

Git: The Version Control Which Leapt Through the Time. 2014/10/31 Talk @ NTU Open Source Community, Taipei, Taiwan.

B3ecf4287d58054135af5d7b4d741021?s=128

Poren Chiang

October 31, 2014
Tweet

Transcript

  1. 瑭馊儘瑠涸 晝劥䱾ⵖ 34$IJBOH㩎厣⟤ $$#:4" (JU /5604$荩㣐Ꟛ彂爢

  2. ⵹縨⡲噠

  3. ⵌㆭ酭䪪(JU ˖ 㥶卓ꨶ舡♳鼩尝剤涸鑨ĈĈ ˖ 8JOEPXT(JUGPS8JOEPXT N4ZT(JU  ˖ 0499DPEFㄐ⟂⴪䊨Ⱘ ˖

    -JOVY apt-getFUD UIPVHIVOMJLFMZ
  4. 㛇劥须鎝 HJUDPOHHMPCBMVTFSOBNF4IVJZVBO%JBP HJUDPOHHMPCBMVTFSFNBJMOUVUSVDL!HNBJMDPN 剐䳖䧭⡹涸そ㶶騈䢫欽⥌盳
 鸏僽(JU欽⢵陏ⴽ⡹涸倰䒭

  5. ♧⴪盘

  6. HJUJOJU ˖ 㖈湡⵹涸须俲㣰㾝Ꟛ"5⸂㜥晝劥䱾ⵖ ˖ 㛇劥欽岁cd <湡ꏗ> && git init ˖

    鹎ꥣ欽岁git init <湡ꏗ> ˖ 㛂遤痧✳妄剚涮欰♶㥪涸✲
  7. None
  8. ✳䮋鼇墂呪

  9. HJUBEE ˖ 䪾墂呪⸈鹎(JU盘椚涸眕㕠酭 ˖ 䧴僽䪾⥜佖䖕涸墂呪秝Ⰵ晝䱾眕㕠⚥ ˖ ♧菛铃岁git add <墂呪䧴须俲㣰> ˖

    阌䢆⢪欽git add .
  10. HJUBEE

  11. HJUSN ˖ 䖰晝劥䱾ⵖ䏨騈须俲㣰ず儘ⵅꤑ墂呪 ˖ ♧菛欽岁git rm <墂呪> ˖ 㥶卓♶䋞劆墂呪劥넓鄄獵ꤑ〳⟃欽--cached

  12. – – HJUSN

  13. ♲娝墂

  14. HJUTUBUVT ˖ 溏溏湡⵹涸䞕屣 ˖ 剚ⴕ䧭չ䊺鼇《涸墂呪պչ劢鼇《涸墂呪պ
 չ㼿劢⸈鹎晝劥䱾ⵖ涸墂呪պ

  15. HJUDPNNJU ˖ 㼟湡⵹鼇涸墂呪娝墂䧭♧⦐DPNNJU晝劥 ˖ 剚䩧Ꟛ禺窡갸鏤涸管鱀㐼鱒ⰅDPNNJUNFTTBHF ˖ ♧菛欽岁git commit ˖ ♧遤⨞㸤git

    commit -m "<鎝䜂>"
  16. HJUMPH ˖ 增鋕䊺竤DPNNJU涸晝劥鎹ꏗ ˖ ♧菛欽岁git log ˖ 㥪隡晝git log --oneline

    --graph
  17. 㔋㔐彸晝劥

  18. #SBODI 晝劥埠 HJUDIFDLPVU HJUSFTFU 植㖈晝劥

  19. HJUDIFDLPVU ˖ 䖰晝劥鎹ꏗ⚥隡ⴀ俒⟝ ˖ 㔐ⵌ麕⿡git checkout <晝劥> ˖ 鼩⾲暶㹁墂呪git checkout

    <晝劥> -- <墂呪>
  20. HJUSFTFU ˖ 儘꟦⦝鱲ⴗ䳖⚆歲箁涸ⵄ㐼 ˖ 㔐鷎♧⦐晝劥git reset HEAD^ ˖ 㔐鷎ⵌ厥♧儘꟦git reset

    HEAD@{2days} 倞晝劥 莍晝劥
  21. ❀佞♳ꨣ畮

  22. HJUSFNPUF ˖ 鏤㹁黇畮鸮箁须鎝 ˖ 鸒䌢〫剚欽ⵌ♴꬗鸏♧遤
 git remote add <そ珖> <騟䖜>

  23. HJUQVTI ˖ 㼟ꨶ舡♳涸晝劥埠䲀ⵌ黇畮 ˖ 痧♧妄㛂遤git push origin master -u ˖

    莅黇畮䒊用ꡠ耢⛓䖕㽠〳⟃湬䱺欽git push✫
  24. HJUDMPOF ˖ 䖰黇畮䪾厥⦐晝劥䱾ⵖ䏨䭡頺♴⢵ ˖ ♧菛欽岁git clone <笪㖧> [须俲㣰そ珖] ˖ 〳⟃僽须俲㣰笪㖧䧴僽44)湡ꏗ

  25. 眕⢿(JU)VC

  26. ♴妄爢铭 劍⚥罌鹋 馜䘰㔐⿡㈥剅ゅ s〡A  ! 劍⚥罌䖕痧♧妄爢铭 㖒럊崞㣐 ! 湱ꡠ须鎝剚佞㖈)BDLQBE莅爢㕰

  27. 2VFTUJPOT 34$IJBOH $$#:4" /5604$荩㣐Ꟛ彂爢