git pull --ff-only upstream <branchname>
Fast-forward merge from `upstream` into current branch.
This command updates your current branch with changes from the upstream
repository's <branchname>
branch, but only if it can be done with a fast-forward merge.
It fetches the changes from the upstream
remote and then attempts to integrate them into the current branch without creating any new commits. If a fast-forward merge isn't possible due to divergent history, the process will be aborted.
Examples:
git pull --ff-only origin main
git pull -ff-only upstream develop