git checkout main
git merge --squash <branch> # Merge all commits on the branch
git commit -am "squash merge commit" # Commit the changes
git branch -D <branch> # Force deletion of local branch
git push origin :<branch> # Delete remote branch
git push