3

[ github ] 忽略目錄裡的文件但不忽略目錄的方法

 2 years ago
source link: https://webber0928.blogspot.com/2015/09/github.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

[ github ] 忽略目錄裡的文件但不忽略目錄的方法

有時候我們想保留一個目錄在Git版本庫上,但不需要其中的文件。如
log --
     |- 1.log
     |- 2.log
而Git本身不允許空目錄提交上去,一個方法是在目錄下創建一個文件
    mkdir log && touch log/.gitkeep && git add log/.gitkeep

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK