Skip to content

Do not offer to push to Git if remote push URL is no_push #45271

@TomasHubelbauer

Description

@TomasHubelbauer

There seems to be no official way to prevent pushing to a remote in Git, but people often recommend setting the push URL of a remote to something invalid. (Can't clear it fully because Git would fallback to the fetch URL).

git remote set-url --push origin no_push

It would be good if the VS Code Git SCM provider could check for git:, ssh: and https: URLs and if it finds an unsupported URL format, hide the Push part of the Sync button in the bottom bar. Pulling should continue to work.

In case white listing protocols is deemed too potentially disruptive (maybe people are using custom protocols?), a black list approach could be considered where no_push (and other values?) would cause the push icon to be hidden.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygitGIT issueshelp wantedIssues identified as good community contribution opportunitiesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions