How to ignore all subfolders in a folder with .gitignore

前端 未结 2 1761
一个人的身影
一个人的身影 2021-02-13 15:14

I have a folder in Git with some files in it. Files are a part my Git repository. When running my project some work directories appear in this folder. Directories can have any n

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 15:44

    Try this:

    !folder/
    folder/*
    

    The first line excludes the top level from being ignored, and the second line ignores all subfolders.

提交回复
热议问题