Github 架設網頁
Step 1 : 建立 github 帳號 這部分我就跳過,註冊很簡單,我就附上網路的教學 開始使用 GitHub 。
建立完成如下圖:
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
Step 2 : 創建 repository (以下我簡稱為repo) 建立完帳號,就可以創建屬於你的repository
點選 new repository
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
Create repository name Step 3 : 把 repo 設定為 github page Step 4 : git 的下載
下載完成後,使用快捷鍵 windows+R
進入 CMD 命令提示字元
檢查是否有git版本 輸入 git --version
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
Step 5 : git 的操作 這裡我只提目前會用到的指令部分。
將建立好的 repo (你的 repo 網址)下載/複製到本地端指定目錄
git clone https://github.com/帳號/repo_name
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
我的例子 : 利用 git 將 test 放到本地端就可以進行版本控管。
clone 完成,檔案及路徑如下
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
接下來將你的專案的資料檔案放到此目錄裡面,這裡我用 index.html
當我的專案檔案
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
你將檔案新增到本地端,但是 github 上並沒有做更動,所以這時候就要將本地端新增的檔案更新到 github 上。
cd repo
進入到你的目錄
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
讓 github 知道你是誰
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
針對版本控管
git add . //將 repo_name 資料夾裡的檔案一次全部加入
git commit -m "註解內容" //對所加入檔案新增註解
git push //將上述步驟推上去 github
git pull //把檔案抓下來本地端,確保與 github 上一致,每次修改都要 push 上去 pull 下來
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
git 的一些其他檢視指令
git status //查看你的 repository 與 本地端 狀態一致與否
git log //看commit狀況
總結 github 是甚麼可以上網 google,會需要用到它就是擺一些自己的作品集合,跟夥伴一起開發專案很方便,不用放在雲端或者是 line 在那邊下載來下載去,可以跟夥伴針對一個專案一起控管,這裡我也就不細講了。
這裡其實很多都只是皮毛,不管是 github 的使用, git 的操作你們都可以上網多看看多學,還有 windows CMD的指令 (用 MAC 的人就去學 linux 指令)都可以去玩玩看。