Squash all commits ahead of master from your development branch in a new branch

Ensure that you are in your current branch on the latest commit

Create a copy of it via:

git checkout -b to-be-squashed-branchname

Ensure that your master is up to date.

Then perform a soft reset on your new branch - this will remove all commits up to the latest master commit and your changes will be retained in the current files.

git reset --soft origin/master

Then create a single commit with all of your changes.

git commit -a -m "MESSAGE"

Then you can push your new branch and submit a PR to your project with only a single commit which can be simply merge in master.

Happy coding! :)