Enabling GIT Force Push in SourceTree

For some reason Atlassian SourceTree not only disallows force push by default, but actively hides the feature. I suppose this is to prevent people new to the GIT versioning system from performing destructive operations.

Unfortunately, developers often wrongfully assume SourceTree does not support this feature. Thankfully there is a very simple way to enable force push in the UI.

How to enable force push
How to enable force push

After going into the application preferences, there is a tiny checkbox squirreled away which enables force push.

Warning

With great power comes great responsibility. Make sure you understand what you’re doing in GIT and never I mean never force push over a branch you do not “own”. Also, if you force push to the master branch while sharing a repo with others, you probably deserve to be murdered in your sleep.

You have been warned.

Further Reading

How to use GIT reflog to recover lost commits


comments powered by Disqus