I make new branch from master with:
master
git checkout -b testbranch
I make 20 commits into it.
Now I want to squash those
Another solution would be to save all commit logs to a file
git log > branch.log
Now branch.log will have all commit ids since beginning.. scroll down and take the first commit (this will be difficult in terminal) using the first commit
git reset --soft
all commits will be squashed