88
幸福快樂的完美結局 LESSON 6

幸福快樂的完美結局

  • Upload
    anna-su

  • View
    354

  • Download
    3

Embed Size (px)

Citation preview

Page 1: 幸福快樂的完美結局

幸福快樂的完美結局

LESSON 6

Page 2: 幸福快樂的完美結局

1. Sublime Text

2. Git

3. Source Tree

請先安裝以下三個⼯工具

圖⽚片來源- github

Page 3: 幸福快樂的完美結局

幸福快樂的完美結局

LESSON 6

1. 版本控制觀念

2. Git 基本教學

3. GitHub Pages實作

Page 4: 幸福快樂的完美結局

什麼是版本控制?

圖⽚片來源

幫你記錄每⼀一次檔案變更

Version Control System

Page 5: 幸福快樂的完美結局

你可以儲存不同版本的檔案,再讀取任何⼀一次版本紀錄

圖⽚片來源- ⼤大富翁

簡單的說...

Page 6: 幸福快樂的完美結局

為什麼要使⽤用版本控制?

圖⽚片來源

可以管理個⼈人或團隊間的檔案紀錄

Page 7: 幸福快樂的完美結局

Before個⼈人檔案紀錄-使⽤用版本控制之前

Page 8: 幸福快樂的完美結局

After個⼈人檔案紀錄-使⽤用版本控制之後

Page 9: 幸福快樂的完美結局

團隊間使⽤用版本控制

圖⽚片來源 - 連猴⼦子都能懂的Git⼊入⾨門指南

Page 10: 幸福快樂的完美結局

幸福快樂的完美結局

LESSON 6

1. 版本控制觀念

2. Git 基本教學

3. GitHub Pages實作

Page 11: 幸福快樂的完美結局

圖⽚片來源

Page 13: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 新增本地數據庫

MAC

Page 14: 幸福快樂的完美結局

新增本地數據庫MAC

Page 15: 幸福快樂的完美結局

新增本地數據庫MAC

Page 16: 幸福快樂的完美結局

新增本地數據庫MAC

Page 17: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 新增本地數據庫

Windows

Page 18: 幸福快樂的完美結局

新增本地數據庫Windows

Page 19: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 新增本地數據庫

Command line

Page 20: 幸福快樂的完美結局

使⽤用git init 來建⽴立數據庫

Page 22: 幸福快樂的完美結局

Git屬於分散式管理

圖⽚片來源 - 連猴⼦子都能懂的Git⼊入⾨門指南

Page 23: 幸福快樂的完美結局

新增遠端數據庫 點選New repository

Page 24: 幸福快樂的完美結局

新增遠端數據庫 編輯 repository 資料

Page 25: 幸福快樂的完美結局

新增遠端數據庫 連結遠端repo的⽅方法

Page 26: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 連結遠端數據庫

MAC

Page 27: 幸福快樂的完美結局

連結遠端數據庫 連結遠端repo的⽅方法

MAC

Page 28: 幸福快樂的完美結局

連結遠端數據庫 連結遠端repo的⽅方法

MAC

Page 29: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 連結遠端數據庫

Windows

Page 30: 幸福快樂的完美結局

連結遠端數據庫 連結遠端repo的⽅方法

Windows

Page 31: 幸福快樂的完美結局

連結遠端數據庫 連結遠端repo的⽅方法

Windows

Page 32: 幸福快樂的完美結局

連結遠端數據庫 連結遠端repo的⽅方法

Windows

Page 33: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 連結遠端數據庫

Command line

Page 34: 幸福快樂的完美結局

git remote add test-remote https://github.com/AnnaSu/add-repo-demo.git

連結遠端數據庫(git remote add 名稱)

git remote查看遠端儲存庫名稱

Command line

Page 35: 幸福快樂的完美結局

加⼊入檔案

提交檔案

圖⽚片來源1

圖⽚片來源2

推送檔案

git push

③④git pull

更新檔案

Page 36: 幸福快樂的完美結局

編輯檔案執⾏行專案的過程中,我們可能不斷的新增或編輯檔案

在資料夾內新增 index.html 檔案

使⽤用git status 可以查看,⺫⽬目前專案的狀態

例如:

Page 37: 幸福快樂的完美結局

git add①

加⼊入檔案

圖⽚片來源- github

Page 38: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 加⼊入檔案到staging area

MAC

Page 39: 幸福快樂的完美結局

將檔案加⼊入Repository

加⼊入檔案(git add 檔名)MAC

Page 40: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 加⼊入檔案到staging area

Windows

Page 41: 幸福快樂的完美結局

將檔案加⼊入Repository

加⼊入檔案(git add 檔名)Windows

Page 42: 幸福快樂的完美結局

將檔案加⼊入Repository

加⼊入檔案(git add 檔名)Windows

Page 43: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 加⼊入檔案到staging area

Command line

Page 44: 幸福快樂的完美結局

將檔案加⼊入Repository

指令輸⼊入 git add index.html

加⼊入檔案(git add 檔名)

Page 45: 幸福快樂的完美結局

git commit②提交檔案

圖⽚片來源- github

Page 46: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 提交檔案到repository

MAC

Page 47: 幸福快樂的完美結局

按下Commit 按鈕,將檔案加⼊入Repository

提交檔案(git commit -m “提交訊息”)

MAC

Page 48: 幸福快樂的完美結局

輸⼊入提交訊息,再按下Commit 按鈕

提交檔案(git commit -m “提交訊息”)

MAC

Page 49: 幸福快樂的完美結局

選擇要提交的branch

提交檔案(git commit -m “提交訊息”)

MAC

Page 50: 幸福快樂的完美結局

完成提交,建⽴立第⼀一個版本

提交檔案(git commit -m “提交訊息”)

MAC

Page 51: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 提交檔案到repository

Windows

Page 52: 幸福快樂的完美結局

提交檔案(git commit -m “提交訊息”)

Windows

按下Commit 按鈕,將檔案加⼊入Repository

Page 53: 幸福快樂的完美結局

提交檔案(git commit -m “提交訊息”)

Windows

輸⼊入提交訊息,再按下Commit 按鈕

Page 54: 幸福快樂的完美結局

提交檔案(git commit -m “提交訊息”)

Windows

完成提交,建⽴立第⼀一個版本

Page 55: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 提交檔案到repository

Command line

Page 56: 幸福快樂的完美結局

將檔案加⼊入Repository

指令輸⼊入 git commit -m “create index.html”

提交檔案(git commit -m “提交訊息”)

git log查看檔案

Page 57: 幸福快樂的完美結局

git pull③

更新檔案

圖⽚片來源- github

從遠端

Page 58: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 從遠端更新檔案

MAC

Page 59: 幸福快樂的完美結局

更新檔案 (git pull)

MAC

點選Pull 按鈕,即可從遠端數據庫更新檔案

Page 60: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 從遠端更新檔案

Windows

Page 61: 幸福快樂的完美結局

Windows

點選Pull 按鈕,即可從遠端數據庫更新檔案

更新檔案 (git pull)

Page 62: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 從遠端更新檔案

Command line

Page 63: 幸福快樂的完美結局

從遠端數據庫更新檔案

指令輸⼊入 git pull

更新檔案 (git pull)

Command line

Page 64: 幸福快樂的完美結局

git push④

推送檔案

圖⽚片來源- github

到遠端

Page 65: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 推送檔案到遠端

MAC

Page 66: 幸福快樂的完美結局

推送檔案(git push)MAC

點選Push 按鈕,即可上傳檔案到遠端數據庫

Page 67: 幸福快樂的完美結局

DEMO我們使⽤用Source Tree - 推送檔案到遠端

Windows

Page 68: 幸福快樂的完美結局

推送檔案(git push)

點選Push 按鈕,即可上傳檔案到遠端數據庫

Windows

Page 69: 幸福快樂的完美結局

推送檔案(git push)

點選Push 按鈕,即可上傳檔案到遠端數據庫

Windows

Page 70: 幸福快樂的完美結局

推送檔案(git push)

上傳檔案到遠端數據庫處理中

Windows

Page 71: 幸福快樂的完美結局

推送檔案(git push)

已上傳檔案到遠端數據庫

Windows

Page 72: 幸福快樂的完美結局

DEMO我們使⽤用Command line - 推送檔案到遠端

Command line

Page 73: 幸福快樂的完美結局

上傳檔案到遠端儲存庫

指令輸⼊入 git push test-remote master

推送檔案(git push)

git fetch [remote-name]

從遠端儲存庫擷取或合併

Command line

Page 75: 幸福快樂的完美結局

git add① 加⼊入檔案

圖⽚片來源- github

git commit② 提交檔案

git pull③ 更新檔案從遠端

git push④ 推送檔案到遠端

Page 76: 幸福快樂的完美結局

幸福快樂的完美結局

LESSON 6

1. 版本控制觀念 2. Git 基本教學

3. GitHub Pages實作

Page 77: 幸福快樂的完美結局

圖⽚片來源

Page 78: 幸福快樂的完美結局
Page 79: 幸福快樂的完美結局

GitHub 是⺫⽬目前全世界最多⼈人採⽤用的 Git 線上管理平台, 包含完整的議題追蹤機制,更有成千上萬的開源碼專案都在 GitHub 進⾏行 Git 版本控管。

Page 80: 幸福快樂的完美結局

GitHub 帳戶申請教學與實作

LESSON 5 ( 番外篇 )

Page 81: 幸福快樂的完美結局
Page 82: 幸福快樂的完美結局
Page 84: 幸福快樂的完美結局

DEMO

Page 86: 幸福快樂的完美結局

第六堂課 5/5 - 幸福快樂的完美結局

第五堂課 4/28 - 偷呷步的網站快速⼊入⾨門

第四堂課 4/21 - 調配網站的明星花露⽔水

第三堂課 4/14 - 搭載網⾴頁核⼼心的基本架構

第⼆二堂課 3/31 - 前端界流傳的神奇招式

第⼀一堂課 3/24 - 窺探網站建置的任意⾨門

Page 88: 幸福快樂的完美結局

分享結束,很高興認識大家 ,謝謝:)