FahamLah

Commands

git push --force-with-lease

git push --force-with-lease

Risk: Can lose work

What it does

Overwrites the remote branch with yours. Other people's commits there can be lost.

When to use it

Only on your own branch, after a rebase or amend.

Example

$ git push --force-with-lease

Force, but stop if someone else pushed since your last fetch.

$ git push --force

Force with no safety check. Avoid it.