Question about commands before merging

I have a branch b1. I have committed “test.c” with the message “Test file test.c”. Then I open a pull request. The pull request is approved by a coworker. Before I am allowed to merge, I have to execute the following commands:

  1. git checkout master
  2. git fetch origin
  3. git rebase origin/master
  4. git push -f
    What is the result of these commands? Usually I merge the branch directy after the approve of my pull request.

Hi @ppp3,

Thank you for being here! Rebasing an existing Pull Request can result in undesirable / unintended results in some cases, especially when the Pull Request branch is far behind the base. We normally encourage folks to make sure their Pull Request branch is up to date with the base branch before creating the Pull Request. This ensures the last common ancestor is the most up to date. I hope this helps!