I realised this today

miridius@lemmy.world to Programmer Humor@programming.dev – 608 points –
25

You are viewing a single comment

And then notice the spelling error.

Instant commit --amend + push --force

Prefer --force-with-lease. It doesn't make a difference in this scenario, but it's a safer habit/default.

There is no reason to force push anymore - force with lease is always preferable. So said, a frequent rebaser.

Wait what is the difference between the two?

Force with lease will send up what your local thinks the most recent commit on the branch was and the host will reject the push if it knows of a more recent commit on that branch. Basically, it saves you from overwriting a commit you didn't realize existed.

1 more...