Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid tons of commits when debugging Heroku app

While trying to sort out bugs with apps on Heroku, I usually end up with a bunch of Git commits related to the bug fixing process, as I need to commit the updates in order to push to Heroku. Are there any clever ways of cleaning up those commits prior to pushing to the main shared repo for the project?

like image 918
Matt Fordham Avatar asked Dec 12 '11 20:12

Matt Fordham


1 Answers

Create a new branch when you start debugging (git checkout -b debugging or similar), and then make all your commits on there, pushing them to Heroku instead of your master via git push heroku debugging:master.

Then when you've fixed the problem, you can squash your debugging changes into a single commit and merge them back into master:

git checkout master
git merge debugging --squash
git branch -D debugging

There are lots of other ways to go about doing this, it all comes down to which you find the most logical.

like image 159
Andrew Marshall Avatar answered Oct 26 '22 05:10

Andrew Marshall