保留空資料夾

#Git

whck6

$ tree -La 1
.
├── .git
├── .gitignore
├── README.md
├── application
├── assets
├── index.php
├── system
└── vendor

建立一個 .gitignore 在一個空資料夾

$ tree -La 1
.
├── .git
├── .gitignore
├── README.md
├── application
├── assets
├── index.php
├── system
├── test
│└── .gitignore
└── vendor

假如想要保留 test 資料夾在 git 上,你可以順便利用這個 .gitignore.

$ vim test/.gitignore
*
!.gitignore

.gitkeep

也可以達到一樣的效果。

http://www.ryanwright.me/cookbook/git/gitkeep