Combining multiple commits before pushing in Git
“Squashing” in git to merge all of your unpushed commits:
git rebase -i origin/master
-i interactive the file in text editor:
pick 16b5fcc Code in, tests not passing pick c964dea Getting closer pick 06cf8ee Something changed pick 396b4a3 Tests pass pick 9be7fdb Better comments pick 7dba9cb All done
Alteration the pick to squash :
pick 16b5fcc Code in, tests not passing squash c964dea Getting closer squash 06cf8ee Something changed squash 396b4a3 Tests pass squash 9be7fdb Better comments squash 7dba9cb All done
Save your file and exit your editor file and then another text editor will open to combine the message from this file.