Make .gitignore ignore everything except a few files

前端 未结 23 2627
无人共我
无人共我 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条回答
  •  梦毁少年i
    2020-11-22 01:03

    I have Jquery and Angular from bower. Bower installed them in

    /public_html/bower_components/jquery/dist/bunch-of-jquery-files
    /public_html/bower_components/jquery/src/bunch-of-jquery-source-files
    /public_html/bower_components/angular/angular-files
    

    The minimized jquery is inside the dist directory and angular is inside angular directory. I only needed minimized files to be commited to github. Some tampering with .gitignore and this is what I managed to conjure...

    /public_html/bower_components/jquery/*
    !public_html/bower_components/jquery/dist
    /public_html/bower_components/jquery/dist/*
    !public_html/bower_components/jquery/dist/jquery.min.js
    /public_html/bower_components/angular/*
    !public_html/bower_components/angular/angular.min.js
    

    Hope someone could find this useful.

提交回复
热议问题