There is no problem not worth solving, and no technology not worth learning!

When parsing and applying the implementation of .gitignore class rules, configuration optimization of .gitignore files

现在期望于:/assets/apps/ 目录下的 /css、/images、/js、/locales、webpack.mix.js 等文件应该被忽略掉,现在的配置如下

1. Reference:https://www.shuijingwanwq.com/2022/06/10/6593/, based on Togos/phpGitIgnore for parsing and applying .gitignore class rules implementation

2. Now expect that the /css, /images, /js, /locales, webpack.mix.js and other files in the /assets/apps/ directory should be ignored. The current configuration is as follows. as shown in Figure 1

现在期望于:/assets/apps/ 目录下的 /css、/images、/js、/locales、webpack.mix.js 等文件应该被忽略掉,现在的配置如下
Figure 1

/apps/**/css/*
/apps/**/images/*
/apps/**/js/*
/apps/**/locales/*
/apps/**/webpack.mix.js


3. This stage has not been ignored. For example: /apps/object/backtop/js/backtop.jsx, which should be ignored. as shown in Figure 2

现阶段并未被忽略掉。例如文件:/apps/object/BackTop/js/BackTop.jsx,理应被忽略才是
Figure 2

4. Reference:https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%AE%B0%E5%BD%95%E6%AF%8F%E6%AC%A1%E6%9B%B4%E6%96%B0%E5%88%B0%E4%BB%93%E5%BA%93. Ignore files. # Ignore the .pdf file doc/**/*.pdf under the doc/ directory and all its subdirectories, and confirm that togos/phpgitignore does not support ** . File: apps/object/backtop/js/backtop.jsx has not been ignored. as shown in Figure 3

现阶段并未被忽略掉。例如文件:/apps/object/BackTop/js/BackTop.jsx,理应被忽略才是
Figure 3

apps/**/*.jsx


5. Confirm that only .php files need to be kept in the /apps directory, and other files can be ignored. The editing configuration items are as follows. File: apps/object/backtop/js/backtop.jsx has been ignored, in line with expectations, and only .php files are retained. as shown in Figure 4

确认 /apps 目录下仅需要保留 .php 的文件,其他文件皆可忽略。编辑配置项如下。文件:apps/object/BackTop/js/BackTop.jsx 已被忽略掉,符合预期,且仅保留下 .php 的文件
Figure 4

/apps/*/*/css/*
/apps/*/*/images/*
/apps/*/*/js/*
/apps/*/*/locales/*
/apps/*/*/webpack.mix.js


Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.