In 2021, more and more people are using itrebaseTo take the place ofmergeYou can see that both Github and GitLab are used preferentially when merging coderebaseRelative tomergeSpeaking,rebasePut your commit on the branch you need to merge, so your commit history is clearer, rather than likemergeThat way, no matter how many changes you make, you’ll just be left with a dry Merge COMMIT on the merged branch.

But, it also has a small hole, if your local development branch already has a remote branch, use rebase will modify your local branch, remote branch but you will not have changed, but this time there is no way to directly push, because git think your remote branch and local branch is inconsistent, This does allow you to merge your remote repositories, but when you merge and push, there will be twice as many commit records on the remote repository. One is a record that has always existed on the remote repository. Git will consider them to be two different sets of records. This situation is a bit like rebase a remote repository with a local repository.

The commit growth will be exponential, and often your Merge request leader has not approved, someone else’s merge request has already been merged into the main branch, when it is your turn to rebase again, and when your merge request is doubled again, God knows how many merge conflicts I did that day, and rebase was auditing over 100 commit records at a time. Git rebase –continue

So the right thing to do is to do a force push.