I have committed and pushed some files to remote feature branch and created a merge request. I used
git commit -a -m "blah blah"
git push
So it pushed all the modified files. One of the files (which is an existing file in in the master) was not supposed to be pushed (like for e.g. executables). How do I remove this file from the merge request, so that when the MR is merged into master, the unwanted file is not merged (as if it was never there in the MR). I found this page mentioning the following commands
git rm {filename} --cached
git commit -m "[...]"
git push
I tried the commands, but do not see the file removed in the merge request in Gitlab. Is this the right way to do it?
Update1:
With the above commands, I could see the file mentioned as deleted in the above commit. But then when I merge the updated MR into master, the file is deleted from master too.
Update2:
Removed sentences causing confusion and updated the title