如何在调试Heroku应用程序时避免大量提交 [英] How to avoid tons of commits when debugging Heroku app

查看:95
本文介绍了如何在调试Heroku应用程序时避免大量提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试使用Heroku上的应用程序清理错误时,我通常会得到一堆与错误修复过程相关的Git提交,因为我需要提交更新以推送到Heroku。在推送到项目的主要共享回购之前,有没有什么聪明的方法可以清理那些提交?解决方案

创建一个新的当你开始调试时( git checkout -b debugging 或类似),然后在那里进行所有提交,并通过<$ c $推送到Heroku而不是你的主站c> git push heroku调试:master 。

然后当你修复了这个问题后,你可以将调试更改压缩到一个提交中并将它们合并回master:

  git checkout master 
git合并调试--squash
git分支-D调试

还有很多其他方法可以做到这一点,这一切都归结为哪些你发现最合理的。

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?

解决方案

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.

这篇关于如何在调试Heroku应用程序时避免大量提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆