If the goal is to put all the changes in one commit, you probably can squash them together by using (for N commits, N can be any number of commits):
git rebase -i HEAD~N
if the goal is to get the commits from master and get the "squashed commit" on top of these change (assuming your branch was created out of master), please consider the following:
>> // while being in <ultrafeature> branch
git fetch --all
>> git rebase origin/master
After these commands your commit(s) will be on top of newest master commits. Of course the rebase will fail if there are conflicts, so it will be possible to resolve them and then proceed with git rebase --continue
Last but not least, when you create a Pull Request and your colleagues start to comment and as a result you made more commits (say commitA, commitB, and commitC),
you can squash everything and then "re-push" the change, by applying a forcefull push:
git push -f ultrafeature
So, all-in-all I use the following technique:
//while being on master
git checkout ultrafeature
git commit, commit, commit // here is my work, say 3 commits
git rebase -i HEAD~3 // create one commit out of 3 when I'm done
git push -u origin ultrafeature
// create a pull request
// my colleagues make comments, so I commit again and again (1 more commit)
git rebase -i HEAD~2 // unify a squashed commit with a new commit, in a trivial case it can be also git commit --amend
// now I'll be able to "submit" my changes:
git fetch --all
git rebase origin/master
git push -f
// merge / ff merge into master, usually in UI where I've opened a pull request