GIT 建立專案

tags: GIT Work 版本控管 報表

如何在在本機建立版本控制 有兩種

檔案已經存在

確認好要控管的檔案路徑後,接著請輸入要控管的檔案路徑

D:\IronMan_D

接著請輸入

git init

確認指令有沒有成功,請輸入

git status

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 →

還沒有建立檔案的(省略)

就在建立的時候加入版本控制,請輸入建立資料夾的指令

cd d:
mkdir NewFolder

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 →

再進入新建立的資料夾裡面建立版本控制,請輸入指令

cd newfolder
git init

使空白資料夾內都有一個空的文字檔能讓Git去commit

find . -name .git -prune -o -type d -empty -exec touch {}/.gitignore \;

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 →

這個.gitignore檔案是可以隱藏的

補充

果確認兩項檔案都要加入而不想要一次只能加入一項檔案的話,
可以使用萬用字元來加入要控管的檔案,請輸入

git add *.html

但是如果附檔名的檔案太多不想一一確認的話,可以直接全部加入檔案控管,請輸入

git add --all

上一篇-基礎 | 下一篇-雲端儲存庫