Push With Force Flag - egnomerator/misc GitHub Wiki

The command

# generic
git push origin <your_branch_name> --force
# or
git push origin <your_branch_name> -f

# specific repo by url
git push <URL> --force

Sources

SO source

Rewrite history already pushed to remote

General Information

There are some git operations that cause changes which require pushing with the force flag to apply those changes to the remote repository.

  • e.g. git operations that re-write public history (as apposed to re-writing local-only history)

note: pushing with the force flag requires special permission on that remote repository

⚠️ **GitHub.com Fallback** ⚠️