What's the difference between Git ignoring directory and directory/*?

前端 未结 4 966
我寻月下人不归
我寻月下人不归 2020-11-28 04:59

I\'m confused about what\'s the correct way to ignore the contents of a directory in git.

Assume I have the following directory structure:

my_project         


        
4条回答
  •  孤街浪徒
    2020-11-28 05:29

    To ignore everything in a directory except dotfiles you can use the following glob-pattern in your .gitignore:

    www/[^.]*
    

    So no need for an extra .gitignore, just simply add a .keep file to your www directory.

提交回复
热议问题