4 ms·
The problem with using Git push to deploy is that when you're first setting up your deployment, if you make a mistake in the settings, you can't amend the commi
by LeafStorm 13y ago
The problem with using Git push to deploy is that when you're first setting up your deployment, if you make a mistake in the settings, you can't amend the commit to fix it, because it's already been pushed - so the mistake stays there for all eternity. And if you try to fix it and your fix doesn't work, that's another bad commit.
I deployed my first project to Heroku a few weeks ago, and now my project history has a handful of permanently unremovable junk commits, which I made solely to force Heroku to rebuild my app.
- schrodinger 13y agoJust use git push -f. Or just push from a branch.
- zimbatm 13y agoHere is how I work on heroku, use a branch, rebase and force push to clean your commit logs: git checkout -b heroku-setup # make some commits git push -u heroku heroku-setup:master # oops, something was wrong # make some more commits git push # ok, everything is working git rebase -i origin/master # squash/remove commits git push -f # test one last time git checkout master git merge --no-ff heroku-setup git push
- tokenizerrr 13y agoYou can rewrite history. This is a bad idea if other people are collaborating on your project, as the new history will be mismatched with theirs. It can still be done safely when properly collaborated, or if you're alone just go for it. http://gitready.com/intermediate/2009/01/31/intro-to-rebase.html http://gitready.com/intermediate/2009/01/31/intro-to-rebase....
- X-Istence 13y agoSo long as the target you are deploying too can't also get pulled from in the mean time you can amend commits all you want and push as often or as little as you want. There is no need for junk commits.