Hello! Yesterday I submitted my first merge request to a KDE software! I forked the repo, applied the edits, committed them and pushed to my fork, and then from gitlab created a merge request. after a few hours, the author pushed something into the master, making my merge request 1 commit behind the master. On the merge request details page, I now get this error:

Merge blocked: the source branch must be rebased onto the target branch.  [rebase without pipeline]  [rebase]

If I try to click on [rebase], I get this red error:

Source branch is protected from force push

what should I do to make my merge request “mergeable” again?

  • Mohammad K.
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    9 months ago

    I guess you should rebase or merge the Master branch into your branch and then push again:

    git checkout master
    git pull origin master
    git checkout yourbranch
    git rebase master
    git push -f origin yourbranch 
    

    But if you got error since that new commit has conflict with your chances:

    git merge master
    git push origin yourbranch 
    
    • glue_snorter@lemmy.sdfeu.org
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      No! Bad dev! No biscuit!

      Never merge master into a feature branch. It’s called a “wrong-way” merge and it makes the history fucking awful.

      You shit in the face of project maintainers when you do this.

      You may not care, in fact many don’t. Also people buy timeshares, read celebrity gossip magazines, and vote for scumbags. They are fucking idiots who don’t know what they are doing. So are people who leave wrong-way merges in shared history.

      In fact, wrong-way mergers are worse, because you can’t just ignore them - git blame rubs your face in their shit, so they shit in your face forever.

      Just don’t fucking do it, OK? Or I will hit you in the throat with a cricket bat soaked in wasps. As a first warning.

      • Mohammad K.
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        Sure I promise not to do it anymore. Calm down. Take a deep breath at first! :)) Could you explain the right way to do it? I’m not expert in using git. Explain the correct way to deal with the situation.