.gitignore exclude folder but include specific subfolder

后端 未结 17 1589
一个人的身影
一个人的身影 2020-11-21 06:36

I have the folder application/ which I add to the .gitignore. Inside the application/ folder is the folder application/language

17条回答
  •  攒了一身酷
    2020-11-21 07:07

    Especially for the older Git versions, most of the suggestions won't work that well. If that's the case, I'd put a separate .gitignore in the directory where I want the content to be included regardless of other settings and allow there what is needed.

    For example: /.gitignore

    # ignore all .dll files
    *.dll
    

    /dependency_files/.gitignore

    # include everything
    !*
    

    So everything in /dependency_files (even .dll files) are included just fine.

提交回复
热议问题