Git Won't Un-Ignore a Directory

前端 未结 5 1954
星月不相逢
星月不相逢 2020-12-31 08:26

I\'d like to only track certain directories in git in a larger project, where most directories will be excluded and only a few will be tracked. So, I wanted to use

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 08:43

    Reviving an old post, in case someone else stumbles on this:

    If you want to ignore all folders/files in the current directory, use a leading slash (/*/ for directories or /* for files); else Git will ignore the pattern recursively, which will cause files in unignored directories to be ignored too...

    With that in mind, the !directory/ pattern unignores directories just fine.

提交回复
热议问题