LoginSignup
4
2

More than 5 years have passed since last update.

在 Git 版本控管中保留空資料夾

Posted at

碰到的問題

在開新的 iOS 專案時,有時候會預先根據團隊或是自己的慣例,開好一些實體資料夾。

但是這時候這些資料夾的裡面是空的,

Git 沒有辦法把空的資料夾夾進版本控管

這樣的情形之下,就必須要在裡面放個什麼東西,讓這些實體資料夾能夠進入版本控管。

.gitkeep 或是 .keep 這樣子的檔案進去

這樣子的檔案只要是個空的檔案就好,

在生成 Rails 全新專案時,空的實體資料夾內,就是放了 .keep

在這邊我會選擇使用 .gitkeep 的原因是比較容易辨識這個空的隱藏檔是要拿來給 Git 用的。

所以如果要在當前目錄的一個叫做 Managers 的目錄安插一個 .gitkeep 檔案的話,只要在終端機輸入:

touch Managers/.gitkeep 

即可。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2