eclipse-egit / egit

EGit, the git integration of Eclipse IDE
https://www.eclipse.org/egit/
Eclipse Public License 2.0
13 stars 6 forks source link

Allow force push with lease option in the Git Staging view (--force-with-lease) #33

Open fapdash opened 2 months ago

fapdash commented 2 months ago

Description

I'd like to have the option to choose force push with lease in the drop down menu of the Git Staging view:

2024-05-16_10-23

Motivation

From SA:

--force-with-lease is a safer option that will not overwrite any work on the remote branch if more commits were added to the remote branch (by another team-member or coworker or what have you). It ensures you do not overwrite someone elses work by force pushing.

https://stackoverflow.com/a/52823955

Since the chosen option isn't always visible I often end up having force push on without thinking about it and force push with lease would stop me from overwriting changes from my collaborators.

Alternatives considered

Make it always visible that the force push option is turned on, might be a viable option as well. If it's feasible in the UI that might be a worthwhile change anyways.

Additional context

No response

tomaswolf commented 2 months ago

Regarding the "alternatives considered": https://github.com/eclipse-egit/egit/wiki/New-and-Noteworthy-6.2#git-staging-view tells: If the "Force Push" option is active, the button's icon shows a little green plus sign top-right.

This is visible in your screenshot.