Presentation is loading. Please wait.

Presentation is loading. Please wait.

GitHub 2015/10/28 鄭雅馨.

Similar presentations


Presentation on theme: "GitHub 2015/10/28 鄭雅馨."— Presentation transcript:

1 GitHub 2015/10/28 鄭雅馨

2 動機 業界的潮流趨勢 研究專案整合 所有圖片出處:google

3 What is Github? What Is Github
*公開的平台,若要鎖起來,須付費 *就算沒有github帳號,也可下載公開的code

4 Git vs. Github Git : 是個版本控制系統,來管理你的程式碼的開 發歷史紀錄 - tool
Github : 是Git延伸出來的一種開發服務 - service for projects that uses Git on the web

5 Github vs. Dropbox Github Dropbox *有版本控制 *可選擇同步的檔案 *無版本控制 *同步所有檔案

6 Why use GitHub 多人開發程式 - 在校時,一個專題可能多人去執行、開發,在 合併成果及程式時,如果用人工去對,常在複
製貼上時,有可能造成錯誤,或是花很多時間 - 在業界中,一個專案也會由多人開發,由於時 間、地點、程式大小的關係,在整合時,單靠 人力會非常沒效率且容易出錯

7 Why use GitHub 版本控制 -以防修改時改錯了,想回復的困難
2:40 建立repositories 12:19 版本控制, history 13:12 github app clone…history…branch

8 出處:https://github.com/

9 Set Up Git 出處:

10 Authenticating with GitHub from Git
出處:

11 GitHub Flow 出處:

12 GitHub Flow 出處:

13 出處:

14 基本開發指令 (在開發資料夾中)git clone + (github上的資料夾網 址)
git remote add + (remote-name) + (來源address) git branch + (branch-name) git checkout (branch-name) 改程式….. git commit -m ".....XXXX“ git push [remote-name] [branch-name] send request….. *將github上的程式下載到local的電腦端,並建立github和local間的連結 *將branch name加為遠端的分支之一 *建立local端branch *切到branch *將修改的程式留段註解,方便以後維護 *push更改的程式到遠端 git checkout –b + (branch_name)

15 其他常用指令集 – 更新 1. git stash 2. git fetch 3. git rebase origin/master 4. git stash pop 如果需要merge時 git mergetool 當要push時,發現遠端程式已有被修改過,須要先更新local端程式,才能上傳 *將local端程式有更改的file先暫存住 *連到遠端找到最新程式 *更新local端程式 *將修改過的程式pop出來 *若遠端新程式和local改到同份檔案,需要merge

16 其他常用指令集 – merge commits
git log git rebase -i <不變動的commit的SHA-1> 變更commits - pick = use commit -squash = use commit, but meld into previous commit 輸入新的commit message *先查看當前有哪些branch commits *進入修改模式,可變動的只有SHA-1之後的commits *變更commits *輸入新的commit

17 其他常用指令集 – delete branch
git branch -D XXX git push remote-name --delete branch-name 開發完之後,刪除branch *砍local branch *砍遠端和local端的連結

18 Github 優缺點 免費的開發平台 版本控制 有許多Open source 1. 所有資源公開,若要隱藏,須付費

19 References Codeschool (入門推!!) https://www.codeschool.com/paths/git
Stackoverflow merge commits rebase-i/ Delete branch e-a-git-branch-both-locally-and-remotely


Download ppt "GitHub 2015/10/28 鄭雅馨."

Similar presentations


Ads by Google