Avoiding conflicts in git when merging a squashed commit from main into feature branch

Consider the following practice: A developer branches from main and creates as many commits as needed in a feature branch Once the feature is completed, all commits are squashed and merged into th...