Instructor: Let's take a look at the git log oneline. We can see the three commits that we haven't pushed yet. Let's say, instead of having all this history, we just want to push this as one commit to the origin.
We can do that with interactive rebase and we can do a git rebase -i, for interactive, and will let you go back three to handle all three of these. We're going to do HEAD~3 and we want to squash this all together. Our command here is going to be squash or we could also use fixup, but squash lets us re-write the commit message.
The idea here is we have to squash new changes down into another change. Let's enter I for insert mode and instead of pick here, we're going to squash this down into Change 2. We're on the squash Change 2 down into Change 1.
Notice that these are assorted, so that the top one is the oldest one. We can hit :wq to save it. Now we are in a new squash merge message.
We could leave all this the same if we wanted all of the different messages or we could enter insert mode and delete all of the old messages. We could just say, "This is our new alert change" and hit :wq to save that.
If we do a git status, we have just one commit. If we do git log oneline, we have all three of our commits squashed into one commit that we can then push. If we do a git push now, then all three of our changes have been pushed in one single commit.