六角體驗營 # Git、GitHub > [六角YT 影片](https://www.youtube.com/watch?v=PNEM7CH3ZAg&list=PLYrA-SsMvTPOZeB6DHvB0ewl3miMf-2tj&index=2)、[六角教學MD檔](https://quip.com/pFUnA7u75HbL) ## 使用終端機撰寫指令 | 指令 | 說明 | example | | ------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------- | | cd | 前往指定資料夾 | cd C:\Users\user>cd C:\Users\user\Desktop\test | | git init | 開始使用數據庫,會建立repository(出現隱藏的.git檔案在資料夾中) | | | git --vision | git是否安裝成功,成功會有版本 | 成功回傳: git version 2.41.0.windows.1 | | git config --global user.name "姓名" | 設定輸入姓名 | | | git config –list | 查詢 git 設定內容(查詢姓名email等) | | | git config --global user.email "信箱" | 輸入個人的 email | | | git status | 查詢當前檔案狀態 | 若當前有資料被追蹤會顯示 | | git add . | 新增檔案到索引區(staging area) | | | git commit -m "這邊輸入更新說明" | 將資料commit到本地數據庫(repository) | 成功會回傳更新內容 | | git log | 顯示commit次數與說明 | | | git push -u origin master | 更新commit到數據庫中(指令會隨角色改變) | | <br><br> ## .gitignore 忽略版控的項目 * 設置在專案資料夾中 ![](https://hackmd.io/_uploads/r1fZRiwGa.png) * 不要版控的項目包含: node_modules,在.gitignore中 ```js= node_modules/ ``` * git status 查看版控項目 (不應有node_modules資料夾) ```terminal= git status ``` ![](https://hackmd.io/_uploads/rytcAjvzp.png =80%x)