Make .gitignore ignore everything except a few files

前端 未结 23 2580
无人共我
无人共我 2020-11-22 00:14

I understand that a .gitignore file cloaks specified files from Git\'s version control. I have a project (LaTeX) that generates lots of extra files (.auth, .dvi, .pdf, logs,

23条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 00:48

    To ignore some files in a directory, you have to do this in the correct order:

    For example, ignore everything in folder "application" except index.php and folder "config" pay attention to the order.

    You must negate want you want first.

    FAILS

    application/*

    !application/config/*

    !application/index.php

    WORKS

    !application/config/*

    !application/index.php

    application/*

提交回复
热议问题