til

safer alternative to git push –force

There is a safer alternative to git push --force.

Use --force-with-lease and --force-if-includes to restrict force pushes so that they don’t unintentionally overwrite commits pushed by others.

git push --force-with-lease --force-if-includes