News for hackers. Stuff that matters.
Re:Better Git configuration by dilap on Thursday April 06, 2017 @01:28PM (#14052633)
Here's one: Use:

    git push --force-with-lease
Instead of

    git push -f
(Obviously ideally you'd never do either, but sometimes life happens.)

The advantage of the former over the latter is that it won't push if you haven't already seen the ref you're overwriting. It avoids the race condition of accidentally "push -f"ing over a commit you haven't seen.

(Why this isn't the default, I have no idea.)

Re:Better Git configuration by scrollaway on Thursday April 06, 2017 @03:13PM (#14053633)
Yes, force-with-lease is really useful. I set it up as an alias of git fpush, and have never used push --force since.