Skip to content

Support Protected branches in VS Code

Problem to solve

Visual Studio Code's Git integration has the ability to mark certain branches as protected, giving users a warning before they try to add commits to one. This improves the experience for new users who are not familiar with the concept of protected branches.

Proposal

GitLab Workflow should provide the branch protection rules for a repository to VS Code. This should possibly come with a user setting to not mark a branch as protected if the user has permission in GitLab to push to protected branches.

Further details

image

Visual indication of protected branch

Screenshot_2024-09-02_at_09.44.05

Warning that appears when trying to Commit

Screenshot_2024-09-02_at_09.43.00

Branch name prompt