没有不值得去解决的问题,也没有不值得去学习的技术!

Optimizing .gitignore Configuration When Parsing and Applying .gitignore-Style Rules

Current expectation: files such as /css, /images, /js, /locales, and webpack.mix.js under the /assets/apps/ directory should be ignored. The current configuration is as follows

1. Reference: Implementation based on TOGoS/PHPGitIgnore for parsing and applying .gitignore-style rules

2. Current expectation: files such as /css, /images, /js, /locales, and webpack.mix.js under the /assets/apps/ directory should be ignored. The current configuration is as follows. See Figure 1

Current expectation: files such as /css, /images, /js, /locales, and webpack.mix.js under the /assets/apps/ directory should be ignored. The current configuration is as follows
Figure 1
Plaintext

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

3. At this stage, they are not being ignored. For example, the file /apps/object/BackTop/js/BackTop.jsx should have been ignored. See Figure 2

At this stage, they are not being ignored. For example, the file /apps/object/BackTop/js/BackTop.jsx should have been ignored
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 . Ignoring files. # Ignore .pdf files in the doc/ directory and all its subdirectories doc/**/*.pdf. Confirmed that TOGoS/PHPGitIgnore does not support ** . The file apps/object/BackTop/js/BackTop.jsx is not ignored. See Figure 3

At this stage, they are not being ignored. For example, the file /apps/object/BackTop/js/BackTop.jsx should have been ignored
Figure 3
Plaintext

apps/**/*.jsx

5. Confirmed that only .php files need to be retained under the /apps directory, and all other files can be ignored. Edited the configuration items as follows. The file apps/object/BackTop/js/BackTop.jsx has been ignored as expected, and only .php files are retained. See Figure 4

Confirmed that only .php files need to be retained under the /apps directory, and all other files can be ignored. Edited the configuration items as follows. The file apps/object/BackTop/js/BackTop.jsx has been ignored as expected, and only .php files are retained
Figure 4
Plaintext

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

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系