git rebase -i master
you will get the editor vm open and msgs something like this
Pick 2994283490 commit msg1
f 7994283490 commit msg2
f 4654283490 commit msg3
f 5694283490 commit msg4
#Some message
#
#some more
Here I have changed pick for all the other commits to "f" (Stands for fixup).
git push -f origin feature/feature-branch-name-xyz
this will fixup all the commits to one commit and will remove all the other commits . I did this and it helped me.