Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can solve the majority of such issues by disabling pushes to a remote repository. Assuming all developers collaborate through a central repository, disabling force push there should avoid commits being lost.

In practice however, I've found a force push can be useful. For example, we once had a dev push code to our deployment branch which wasn't in fact ready for production. We could have just reverted all the commits which were added, but this would be messy and make merging again later painful. Instead, just `git reset --hard` to before the merge and force push.

If you understand the implications of rebase and force push, you shouldn't have to worry about losing data.



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

Search: