# 使用Github Pages上傳網頁 - [x] 用GitHub 上傳網頁 打開iterm 輸入`cd mission`(前往我們剛剛存放已vscode寫好的網頁的資料夾)並輸入`ls`確定檔案有在資料夾裡  輸入git status確認狀態,看到呈現的結果是**紅色**的,代表檔案還沒被加入git  接著輸入 `git add firstDemo.html` 將html加入,並再次輸入`git status`確認狀態,可以發現檔案狀態變成綠色  接著準備git commit (commit代表我們將檔案從暫存提交至檔案庫) 輸入 `git commit -m "add fristDemo.html"` (" " 裡盡量放動詞+名詞讓人知道你做了啥)  輸入`git status`確認狀態clean  - 建造一個branch (gh-pages) git branch 創建一個branch 輸入`git branch gh-pages`  查看`git branch`( 按q結束)  切換到gh-pages 輸入`git checkout gh-pages`就可以切換到gh-pages  輸入`code .` 開啟vscode在專案資料夾創建一個index.html的檔案 存擋  回到iterm輸入`git add .` 將index.html加入並輸入`git status`確認狀態由 紅 變成 綠  到自己的github 創造一個repo,並給定名稱hello_git  回到vscode 再輸入`git remote add origin git@github.com:Chrislinlin/hello_git.git` ## 推上git 輸入 `git push`  創造的repo裡面就有我們剛剛創立的網頁了   ###### tags: `git`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up