I'm trying to rebase and squash all my commits from current branch to master. Here is what I'm trying to do:
git checkout -b new-feature
git rebase -i master
git checkout master
git rebase -i new-feauture
git merge --squash new-feature
When rebasing, Git will not move commits to another branch. It will move the branch including all its commits. If you want to get the commits into master after rebasing on top of it, use
git merge <branch tip or commit of branch> to fast-forward the master branch to that commit.