Rebase
When sitting in the Dev branch developing a new feature, the Main branch can be updated by other people.
If new updates in the branch is related to your developing feature, you would need to get the latest main updates in some way.
One way is to merge main to dev. This is a non-destructive way but also creates a merge-commit, which brings in a lot of history from the main.
The history from the main may mess up your development history and make it hard to read your real history of changes for the new dev feature.
git checkout feature
git merge main
Another way (sometimes not recommended) is rebase.
This moves the entire dev branch to begin on the tip of the main branch, effectively incorporating all of the new commits in main. But instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
git checkout feature
git rebase main
Potential issue with rebase
if you accidentally rebase the main to your dev branch like in below, you rewrite the history of your main branch wrongly while other people are still at the old original main. This would screw up everything and massive merges would be needed to merge things back...
The gold rule is, never rebase a public branch (e.g. main) that is shared by different people. Only rebase your own feature / dev branch and make sure your typing is right.