Windows:https://youtu.be/PldKaxOkN1o
Mac:https://youtu.be/DjgsqLLJrxM
GitHub Desktop 下載連結
請依作業系統 Download
教學操作版本號為 2.4.0 不同版本介面可能有所不同
複製以下的連結,前往 GitHub 官網
https://github.com/
Sign up for GitHub
Skip this step
Options
Name 與 Email 是指我們每一次專案版本修改並提交紀錄的使用者
Repository 的翻譯是儲存庫
意思是會把專案資料夾的檔案複製一份加到 Repository 裡面
從下圖會看到左邊有4個選項
注意
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
我們要選擇選項4
因為我們已經有專案,只是還沒有儲存庫
選項3
是創建一個 空的專案資料夾 與 內建儲存庫
create a repository
建立儲存庫以上選項可以只填寫 Name 就好哩,接著按下 Create Repository
History
會看到以下的初始化檔案紀錄此時專案資料夾內會有 .git 與 .gitattributesImage Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
- .git 是隱藏資料夾 (這個代表著你的儲存庫)
- .gitattributes 這個是 Git 斷行字元處理 (請不要理它)
到這邊就完成了建立 Repository 的流程
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
這邊就不特別 Google翻譯…請自行查詢藍框內的英文
GitHub.com
決定了發佈 GitHub 伺服器的儲存庫是否公開Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
- 取消勾選 = 公開
- 已勾選 = 私密
如果是勾選狀態傳給助教或老師批改就會出現 GitHub 404 頁面
這個時候筆者就把你釘在牆上,我在講你有沒有在看,沒有嘛!!
生成靜態網站的速度,依專案大小而定通常不超過3小時
截止於此,你的專案可以傳給助教或老師檢閱囉
接下來是當建立儲存庫專案已被追蹤,修改後的操作
(1)
這代表1個檔案被修改過標題通常會寫 修改程式碼的主要操作 e.g. 修改 Footer 外距誤差值
描述可以不寫,但是若覺得程式碼修改比較複雜,可以有善利用描述
Commit to master
如果沒有的話,要稍微等一下重新整理
截止於此,修改後上傳已經完成囉
當你建立好儲存庫,你的專案資料夾內有 .git
重新打開後 VS Code 會跳出以下的警示,找不到 Git 應用程式
這是因為 GitHub Desktop 是採內建 Git 應用程式
解決方案:
點擊連結去官方下載 Git 應用程式,全域安裝在你的系統內
這樣 GitHub Pages 會抓不到 index.html
你必須手動更改網址讓它指向 index.html
範例如下
https://username.github.io/儲存庫名稱/work1/index.html/
https://username.github.io/儲存庫名稱/
https://username.github.io/儲存庫名稱/index.html
https://username.github.io/儲存庫名稱/檔名.html
推薦 VScode 套件,可以針對檔案右鍵加入忽略 - 連結
這裡是提供給讀者,學習 Git 的資源參考
謝謝 這篇文章,幫助我很多~ 洧杰
感謝分享~大家要注意路徑的問題喔!我之前卡了很久XDjason06286
謝謝這篇教學文,對於突然換電腦的我,現在再回頭重新設定一次,幫助很大QQ 西零
謝謝分享,從 GitHub Desktop 到 .gitignore~,完整圖文說明 SeanLiu