.gitignore exclude folder but include specific subfolder

后端 未结 17 1625
一个人的身影
一个人的身影 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 06:54

    Add an additional answer:

    !/.vs/              <== include this folder to source control, folder only, nothing else
    /.vs/*              <== but ignore all files and sub-folder inside this folder
    !/.vs/ProjectSettings.json <== but include this file to source control
    !/.vs/config/       <== then include this folder to source control, folder only, nothing else
    !/.vs/config/*      <== then include all files inside the folder
    

    here is result:

提交回复
热议问题