user29678557
user29678557

Reputation: 1

How to Exclude Specific Files from a GitLab Merge Request After Accidentally Merging Deployment Branch Configs?

Problem

I accidentally pulled from a deployment branch (deploymentdev) into our main development branch (main) and pushed it. This brought deployment-specific configuration files (Jenkinsfile, .gitlab-ci.yml, Dockerfile) into the main branch.

Now, when creating a merge request from main to another deployment branch (deploymentstage), these configuration files are included in the changes, which will cause issues because:

  1. Each deployment branch (dev/stage/test/prod) has its own specific versions of these files.
  2. These files should never be merged between deployment branches.

What I've Tried

Important Context

Question

How can I exclude specific files (Jenkinsfile, .gitlab-ci.yml, Dockerfile) from a GitLab merge request without removing them from the repository history or breaking our existing DevOps workflow?

Upvotes: 0

Views: 32

Answers (0)

Related Questions