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

Git Workshop 03

Git Workshop 03

以 git remote 為主軸,搭配 GitHub 實作

Li-Hsuan Chen

October 06, 2016
Tweet

More Decks by Li-Hsuan Chen

Other Decks in Programming

Transcript

  1. 佹㔐CSBODI ˖ 欽HJUSFPH䪪ⵌ鑪CSBODI剓䖕鄄DPNNJU涸⡙縨ⱄ䪾CSBODI⸈㔐齡 ⦐⡙縨♳ • $ git reflog • $

    git branch branchName [commit id] ˖ 殹㖈ⵅꤑCSBODI涸儘⦬剚㔐꺈DPNNJUJEㄤCSBODIOBNF窍⡹呏 亙鸏❉鎝䜂〳⟃䪾CSBODI⸈㔐⢵ • $ git branch -D master • Deleted branch master (was 130d7ba). • $ git branch master 130d7ba
  2. 䩧ꐫ䙦랃鳵 ˖ 䩧ꐫDPNNJU鎝䜂 • git commit --amend -m "new message”

    ˖ 殹㛂遤鸏⦐䭸⟂涸儘⦬DPNNJUJE剚佖隶
  3. ⤑䰦涸䭸⟂ ˖ "MJBTⴽそ • $ git config --global alias.st status

    • --global - 設定別名為使⽤用者 level • st - 別名的名稱 • status - 要被替代的指令 ˖ ⡙縨~/.gitconfig
  4. (JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY  程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪

    佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪
  5. 倞㟞SFNPUF⚛QVTI $ cd /to/your/path (略略) $ git remote add origin

    [remote URL] $ git push -u origin master // push 時可能需要輸入帳號密碼 ⯓⹛䩛⨞⨞溏 ⿡4PVSDF5SFFㄤ(JU)VC溏溏隶⻋