Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #7055

Closed
Open
Created May 30, 2014 by Administrator@rootOwner

Allow forced push to protected branch for particular user or add lock branch api

Created by: VicNumber21

After this change https://github.com/gitlabhq/gitlabhq/pull/6190 it is not possible to perform forced push to protected branch. I do understand the reason why it was done and I'm glad to have such feature. But in some circumstances forced push to protected branch is required still. A good example is mirroring p4 branch (p4 is main repository) to GitLab project to enable working via git. Since p4 is master repo and GitLab is a mirror, p4 history has bigger priority than GitLab one. So if conflict detected, sync user must rewrite history in GitLab and create MR with 'merged' changes to rebase them manually on top of commit synced from p4. Without protection it is hard to guarantee that acceptance of another merge request (or direct push) does not happen while sync process is in progress.

So I'd like to ask you: EITHER: to add some setting to allow forced push to protected branch for some particular user OR: to add permission group (e.g. TOOL) and to allow forced push to protected branch if user is TOOL in particular project OR: to add api like POST /projects/:projectId/repository/branches/:branchId/lock and POST /projects/:projectId/repository/branches/:branchId/unlock and to deny pushing to locked branch for all users except one who locked it. Also admin / owner (master?) should be able to unlock branch via UI

Hope on your understanding.

Assignee
Assign to
Time tracking