Git Workshop 02

Git Workshop 02

481a04548eda340e5cf166b487792ee5?s=128

Li-Hsuan Chen

September 29, 2016
Tweet

Transcript

  1. 12.

    (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪
  2. 13.

    (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git init
  3. 14.

    (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ touch a.txt
  4. 15.

    (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git add a.txt
  5. 16.

    (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git commit -m “add a.txt”
  6. 18.
  7. 20.

    倞㟞CSBODI⚛DPNNJU $ cd /to/your/path $ git init $ touch a.txt

    $ git add a.txt $ git commit -m “add a.txt” $ git branch my-branch $ git checkout my-branch $ touch b.txt $ git add b.txt $ git commit -m “add b.txt” ⯓⹛䩛⨞⨞溏 㖈麕玑⚥欽4PVSDF5SFF溏溏䧭卓
  8. 24.

    倞㟞CSBODI⚛DPNNJU $ cd /to/your/path $ git init $ touch a.txt

    $ git add a.txt $ git commit -m “add a.txt” $ git checkout -b my-branch $ touch b.txt $ git add b.txt $ git commit -m “add b.txt”
  9. 25.

    ざ⢘CSBODI … (前略略) $ git checkout master $ git merge

    my-branch ⯓⹛䩛⨞⨞溏 㖈麕玑⚥欽4PVSDF5SFF溏溏䧭卓
  10. 40.

    遼瑳鍑对㸤䧭䖕 ˖ 鍑对㸤䧭儘䗳갭DPNNJU • git add . // ઌ೺໨㑚Ճೖ stage

    • git commit // ࣥߦ commit ˖ 岤䠑搂岁鍑对儘䗳갭銴鷎ⴀNFSHF垸䒭 • git merge --abort ˖ 岤䠑剤㼠呪墂䚍颶涸㼠呪䗳갭銴增叆僽や〳管陼麕ㄤ齅鱀姻焷䩞 腋鹎遤NFSHFDPNNJU <<<<< ===== >>>>>
  11. 46.

    湡⵹捀姺涸䭸⟂ • git init • git add <filename> • git

    commit -m “message” • git branch <branch name> • git checkout <branch name> • git checkout -b <branch name> • git merge <branch name> • git merge --no-ff <branch name> • git merge --abort • git diff <commit id 1> <commit id 2>
  12. 49.