0

I made the mistake of making too many small commits after committing big changes and then realizing I missed something minor when comparing changes to master in a pull request.

How could I go about removing the previous commits I've made on my branch, and then make just one comprehensive commit with all of the changes I've made? I don't want to revert the code on my local machine to a previous commit.

3
  • 3
    Key search phrase: squashing. Commented Jun 16, 2017 at 16:46
  • The good news is that if you made a bunch of small commits and haven't pushed yet, ye shall have salvation from embarrassment. Pretty much just look up squashing like Oliver suggested.
    – user7851115
    Commented Jun 16, 2017 at 16:49
  • Thanks for pointing out that this is a duplicate. If I do: $ git rebase -i <branch> will this squash only commits in my branch? I don't want to squash any commits in master. Commented Jun 16, 2017 at 16:55

0

Browse other questions tagged or ask your own question.