how to exclude complete pipeline for non matching branches

I want to run my pipeline only for branches =[master, develop, feature/*] if anyone creates a branch other than the mentioned above then the pipeline shouldn’t run.

If there a way to ignore the complete pipeline instead of going to each job and put several conditions?

You can use rules (preferred) or only/except in your .gitlab-ci.yml

You are looking for the workflow:rules feature:

The top-level workflow: keyword determines whether or not a pipeline is created. It accepts a single rules: keyword that is similar to rules: defined in jobs. Use it to define what can trigger a new pipeline.