If you want to ignore all file tracking in the upload folder, but not ignore index.html, single rule
Set as follows in the .gitignore file
uploads/*
uploads/!index.html
But it doesn’t work, index.html is also ignored and not tracked. Is there something wrong with this syntax?
Git version 2.6.3
伊谢尔伦2017-05-02 09:42:59
Create a new .gitignore under the upload folder with the following content:
*
!.gitignore
!index.html
漂亮男人2017-05-02 09:42:59
upload
文件夹下新增.gitignore
, you can put your code uploads/*
uploads/!index.html
Swap the positions, because your rule is
Filter
upload
文件夹下的所有文件, 然后你再不让其忽滤index.html
, all files have been filtered, of course index.html no longer exists
某草草2017-05-02 09:42:59
My personal test was to write it like thisuploads/* uploads/!index.html
It didn’t work. Later I researched it and found that it can be written like this. See my blog post http://blog.csdn.net/CalShell...