Reputation: 1
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:
.gitignore
and running git rm --cached Jenkinsfile .gitlab-ci.yml Dockerfile
, but the DevOps team says this disrupts CI-CD pipeline due to adding these files to .gitignore
.git update-index --skip-worktree Jenkinsfile .gitlab-ci.yml Dockerfile
, but the changes still appear in the merge request since this only affects the local repository, and the changes are already committed.git reset --hard <commit_id>
, but the problematic commits span from one year ago to two weeks ago, making this impractical.deploymentstage
while excluding these files, but this triggered CI/CD pipelines, which I want to avoid..gitignore
because the DevOps team wants to track changes.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