git remote add remoteName https://github.com/user/repo.git
git pull origin otherBranch:otherBranch
3 is the number of commit to squash
git reset --soft HEAD~3
git checkout yourBranch
git reset $(git merge-base targetBranch yourBranch)
git add -A
git commit -m "one commit on yourBranch"
git checkout targetBranch
git merge yourBranch
git push origin --delete yourBranch
git reset $(git commit-tree HEAD^{tree} -m "A new start")