.gitignore exclude folder but include specific subfolder

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

    The simplest and probably best way is to try adding the files manually (generally this takes precedence over .gitignore-style rules):

    git add /path/to/module
    

    You may even want the -N intent to add flag, to suggest you will add them, but not immediately. I often do this for new files I’m not ready to stage yet.


    This a copy of an answer posted on what could easily be a duplicate QA. I am reposting it here for increased visibility—I find it easier not to have a mess of gitignore rules.

提交回复
热议问题