I have a trouble git rebase.
because, I had pushed my local code to origin dev. And, I send a pull request to 'upstream'.
But, There are 1 PR and 7 commits like below the picture

I want to 7commits squash to 1 commit.
What shall I do?
( I have tried : 'git rebase -i HEAD~7', but I have met the message that 'error: cannot rebase: You have unstaged changes.' )
As per my comment, you must commit, stash, or discard all your changes before rebasing. If your changes are complete, you most likely want to commit them (
git add --allfollowed bygit commit).If they are not complete but you want to continue working on them later, use
git stashto save your unfinished changes while also resetting to HEAD. Perform your rebase and then recover these changes withgit stash pop.To instead discard all your changes,
git reset --hard HEADwill do the trick;resetto unstage your changes,--hardto discard them, andHEADto specify the commit to which you are resetting. You should then be able to rebase.It's worth noting that a stash or reset will not affect untracked files. To have these files included, you must first stage them with
git add.