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?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Is there a way to remove IDV Tags from an AIFF fil
相关文章
- 请教Git如何克隆本地库?
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- Django/Heroku: FATAL: too many connections for rol
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
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 viagit 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:
There are lots of other ways to go about doing this, it all comes down to which you find the most logical.
You don't really want to clean up these commits. What you want to do instead is encapsulate them in a merge commit:
git checkout master
git checkout -b my-cool-bugfix
git checkout master
again, then do a non-fast-forward merge. This is essential: forcing non-fast-forward with the--no-ff
option means that a merge commit will always be created. In this case, the command would begit merge --no-ff my-cool-bugfix
.git push heroku
.You can do a
git rebase -i <commit_before_fixing_commits>
and edit / squash / drop the commits and then push to Heroku.