Tower 6.3 - Force Push with Lease
Table of Contents
Our second release for Tower for Mac in 2021 comes with a handy new feature: Force Push with Lease.
Unlike other version control systems, Git’s “push” operation is designed to prevent conflicts from happening on the remote repository. However there’s an option to explicitly overwrite the commit history on the remote with your local one. It’s called
git push --force. You can learn more about it on our learn platform.
The Problem of
git push --force
git push --force gives you the option to change the commit history on a remote, such a force push might overwrite commits on the remote that you did not intend to change. 🧐
Let’s say you work on a branch and rewrite some commits. This will result in a new history that you now want to force push to the remote. If in the meantime one of your colleagues already pushed commits, these commits will be overwritten by your force push (as you haven’t fetched yet). 😱 As you see it can happen quite quickly that you accidentally disrupt your colleagues work.
Force Push with Lease
This is where our new feature comes into play. With version 6.3 Tower now supports the
--force-with-lease flag for the git push command. This safer alternative to the
--force flag allows you to force push in Tower without risking to overwrite your colleague’s code.
From now on if you use force push in Tower and there's already a newer commit on the remote, Tower will show you a warning. You can then review the notification and decide to either cancel or ignore the warning and push your changes anyway.
We hope this new feature will help not to unintentionally overwrite someone else's work. 😊
Version 6.3 also includes a range of fixes and improvements. For a detailed list, please have a look at our release notes.
If you already have a Tower account, make sure to update Tower to the latest version for free.
Not a Tower user yet? Download our 30-day free trial and take it for a spin!