gitlabpushbranchcommitmerge-request

How to commit new changes to an open merge request?


I am new to working in branching and git.

I developed some test cases and created new branch to push the changes in that branch and opened a merge request in GitLab to be merged in master branch.

After PR, my reviewer highlighted some code refactoring and other minor changes.

Now, I have made those changes and the merge request is still open. How can I push the new changes/commit to an already opened merge request?


Solution

  • So, I should follow these steps? -> git add . -> git commit --amend --no-edit -> git push

    No need for git commit --amend: you can make a new commit, explaining why those changes are introduced, and push.

    That will update the current MR (Merge Request in GitLab parlor).

    As mentioned in "Merge requests versions"/

    Every time you push to a branch that is tied to a merge request, a new version of merge request diff is created.

    When you visit a merge request that contains more than one pushes, you can select and compare the versions of those merge request diffs.