Skip to content

Add --force-if-includes option or default to make git push --force-with-lease setting safer #144635

@npbenjohnson

Description

@npbenjohnson

Add --force-if-includes setting or default to prevent unexpected work loss when --force-with-lease is enable in settings.

From official git docs:

A general note on safety: supplying this option without an expected value, i.e. as --force-with-lease or --force-with-lease= interacts very badly with anything that implicitly runs git fetch on the remote to be pushed to in the background, e.g. git fetch origin on your repository in a cronjob.

Other git settings such as "Autofetch" and "Fetch on pull" make vscode especially likely to unexpectedly drop remote changes when performing a force-with-lease push.

Eloquent explanation of flags, tradeoffs, and why unexpected losses could occur: https://stackoverflow.com/a/65839129/1331851

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygitGIT issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions