I am used to amending a commit in TortoiseGit then checking the Force Overwrite Existing Branch (May discard changes) check box in the Push window. But now that check box is missing from the Push window. How can I force push in TortoiseGit now?
Cite source: https://tortoisegit.org/docs/tortoisegit/tgit-dug-push.html#id692368
known changes - This allows remote repository to accept a safer non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This can prevent from losing unknown changes from other people on the remote. It checks if the server branch points to the same commit as the remote-tracking branch (known changes). If yes, a force push will be performed. Otherwise it will be rejected. Since git does not have remote-tracking tags, tags cannot be overwritten using this option. This passes --force-with-lease option of git push command.
unknown changes - This allows remote repository to accept an unsafe non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This does not check any server commits, so it is possible to lose unknown changes on the remote. Use this option with Include Tags to overwrite tags. This passes the traditional --force option of git push command.
If you use TGit 1.8.10+
There are 2 force push checkboxes in Push Dialog. The left one is the new one (--force-with-lease), which is a "safer" way to force push. If your local refs/remotes/origin/master == server's master, then you can force push using this option. If someone changed server's master, your local refs/remotes/origin/master != server's master, then you cannot force push using this option.
The right one is the traditional one (--force), which always discard things.
Your git version is below 1.8.5 So --force-with-lease is unavailable. You only have traditional --force option on the right checkbox.
You may consider to upgrade your git version.
Ref: https://tortoisegit.org/issue/2285
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With