git fetch origin main && git reset --hard origin/main
"Considering the definition of git pull is git fetch && git merge, the merge isn't unexpected." - https://stackoverflow.com/a/12645821
Our alternative approach has become git fetch; git reset --hard origin/master as part of our workflow. It blows away local changes, keeps you up to date with master BUT makes sure you don't just pull in new changes on top on current changes and make a mess. We've used it for a while and it basically feels a lot safer in practice. Just be sure to add/commit/stash any work-in-progress first ! - https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch?rq=1#comment35959558_292357
git pull --rebase
git pullis just a shorthand for
git pull --rebaseis
No, they are quite different.