Hacker News new | past | comments | ask | show | jobs | submit login

I have never had the need to force a push. What are the circumstances that would require it?



you have a private feature branch on git hub, clean it up via rebase (or just rebase to latest master) before review, and you need to force push it.

on long running features, you 1. want to save your state off of your laptop and 2. keep it clean for your own review and for others' review. thus, force push is required, otherwise you'd have to keep making new revs of your branch (branch named joeblow/my_feature_rev_4).


That looks so wrong to me. It says everywhere in the docs "never rebase something that's been published" and it says so for a reason.

The fact that git lets you shoot yourself in the foot doesn't mean you should, definitely not incorporate this into working procedures.

If it's a private feature branch, don't make it public (pushing would still back it up on the server, though you'd have to know the sha1 to fixed it). If it's public, don't rebase it.


> and it says so for a reason.

And yet you don't know the reason. It's because others may have merged your work or be dependent on it. In my case, that doesn't happen, because it's a private branch. I'm the only developer, but other people can look at it for review.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: