# GIT 建立專案 ###### tags: `GIT` `Work` `版本控管` `報表` 如何在在本機建立版本控制 有兩種 * 一種就是檔案[已經存在](https://ithelp.ithome.com.tw/articles/10204634) * 另外一種就是完全[還沒有建立](https://ithelp.ithome.com.tw/articles/10204298)。 ### 檔案已經存在 確認好要控管的檔案路徑後,接著請輸入要控管的檔案路徑 ``` D:\IronMan_D ``` 接著請輸入 ``` git init ``` 確認指令有沒有成功,請輸入 ``` git status ``` ![](https://i.imgur.com/OxcoAWP.png) ### 還沒有建立檔案的(省略) 就在建立的時候加入版本控制,請輸入建立資料夾的指令 ``` cd d: mkdir NewFolder ``` ![](https://i.imgur.com/U5HpIIC.png) 再進入新建立的資料夾裡面建立版本控制,請輸入指令 ``` cd newfolder git init ``` 使空白資料夾內都有一個空的文字檔能讓Git去commit ``` find . -name .git -prune -o -type d -empty -exec touch {}/.gitignore \; ``` ![](https://i.imgur.com/j6OK0rb.png) 這個.gitignore檔案是可以隱藏的 ### 補充 果確認兩項檔案都要加入而不想要一次只能加入一項檔案的話, 可以使用萬用字元來加入要控管的檔案,請輸入 ``` git add *.html ``` 但是如果附檔名的檔案太多不想一一確認的話,可以直接全部加入檔案控管,請輸入 ``` git add --all ``` [上一篇-基礎](https://hackmd.io/eL-LLN-lR8CfUESjB3qWwA?view) | [下一篇-雲端儲存庫](https://hackmd.io/gQfD66LYQ72Aqc37xgdpWQ?view)