The tool you are looking for is git rebase , although you should look at the documentation for this before using it. In general, as a rule, it is good practice to develop at a local branch in order to reduce the overhead of such operations.
When itβs convenient for you, you can use git pull --rebase to use rebase, and not to merge, to resolve the differences after pull, but read the documents first, because it can lose data or cause headaches if used incorrectly. This is a useful but dangerous tool.
source share