Sorry no, that doesn't make sense. As soon as you squash commits, you have a different hash and the history diverges from here. That holds true, even if the actual file content is the same.
Discussion
Yeah that explains it thank you. So is there any way to acheive this while also having the squash feature, effectively 2 linear branches?
No
Try this instead: git rebase -i origin/master. Pick and squash manually. This way you can squash all "cleanup" commits, rewrite some commit messages and deliver a much cleaner PR to master branch. Giant commits with tons of code are meaningless anyway, since you can't read what happened. Managing a clear and understandable git history takes a lot of discipline.