2 minutes March 13, 2026

How Can You Track a Shopware Custom Plugin in Git Using .gitignore?

When working on a Shopware project, developers usually operate inside a full Shopware installation. However, in many cases, only a single custom plugin inside custom/plugins/ needs to be tracked in Git.

Committing the entire Shopware installation can introduce unnecessary files such as core framework code, vendor dependencies, and environment-specific configurations, making repositories heavy and difficult to maintain.

A cleaner approach is to track only the required plugin directory while ignoring the rest of the project. This can be achieved using Git’s inverse ignore strategy, where everything is ignored by default, and only specific paths are explicitly allowed.

Problem: Tracking Only Plugin

By default, Git tracks everything inside a project unless files are explicitly ignored using .gitignore.

In a typical Shopware setup, developers often want to:

  • Track only one plugin inside custom/plugins/
  • Ignore Shopware core files
  • Ignore vendor dependencies
  • Avoid committing environment-specific configuration files
  • Keep the repository clean and deployment-friendly

However, simply allowing a folder inside .gitignore does not work as expected. Git applies ignore rules hierarchically, meaning that if a parent directory is ignored, its child files remain ignored unless they are explicitly re-included.

Solution: Inverse Ignore Strategy

To track only a specific plugin inside a full Shopware installation, you can configure .gitignore to ignore everything first and then selectively allow required directories and files.

For example, if your plugin is located at:

You can use the following configuration:

This setup ensures that:

  • The entire Shopware installation remains ignored
  • .gitignore is still tracked
  • Only the target plugin directory and its files are version-controlled

If files were previously ignored, Git’s internal cache may still hold old rules. In that case, refresh the Git index:

Then verify the results using:

Only the selected plugin folder should now appear as tracked.

Conclusion

Tracking a single Shopware custom plugin inside a full installation is possible using Git’s inverse ignore strategy. By ignoring everything first and then explicitly allowing the required directory hierarchy and plugin files, developers can maintain a clean, lightweight, and manageable repository.

If you are looking for expert Shopware development or custom plugin solutions, explore our Shopware development services to streamline your development workflow and build scalable eCommerce solutions.

 

blog
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Aneesh ceo
Aneesh Sreedharan
Founder & CEO, 2Hats Logic Solutions
Subscribe to our Newsletter
Aneesh ceo

    Stay In The Loop!

    Subscribe to our newsletter and learn about the latest digital trends.