This question has already been answered:
In one rather old project, in the / public directory there are files that are generated by the project itself, but all other files need to be taken under version control. Files that do not need to be added to Git can be written with this pattern: ^[a-z0-9].php$ (regular for PHP, ^ - beginning of line, $ - end), but at the same time there are several files: index.php , main.php , etc, which need to be monitored, but they also fall into the template ^[a-z0-9].php$ . Please suggest how to write such a script in .gitignore ?
.gitignore. You, too, may later have new files in/publicthat will need to be versioned. - Nick Volynkin ♦