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