I have a scenario where I created a merge-request in gitlab for few files from my new dev branch to master. I had a total of 9 commits in my dev branch. In my 3rd commit I had pushed few files which I later realized are no longer required.
So, now in my merge request out of 6 files I want to merge 3 files and want to close this specific merge request. I discovered few solutions which I am describing below but I am looking for a very specific solution.
1) Close this merge request. Create/Checkout a new dev branch change only those files which are required and create a new merge request.
2) Cherrypick the files which you want in your master branch keeping your merge request still open.
3) Merge this request and then cherry pick the changes on to the selected branch by creating a new merge request.
There might be other solutions which I am unaware of. However, I am looking for a specific solution where
- No need to create a new merge request
- No need to create a new branch and copy pasting the required changes.
- Closing this merge request with only 3 files instead of 6.
I am not sure even if this possible. I just want to understand that does git/gitlab have any solution for this.