Search code examples
gitpushtortoisegit

Force Overwrite Existing Branch missing from TortoiseGit push dialogue


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?


Solution

  • 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