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
  • #2647

Closed
Open
Created Jan 17, 2013 by Administrator@rootOwner

'Developer' can push to a protected branch over HTTP

Created by: gorefi

Over SSH a user ('developer') with 'Developer' role in a project is denied pushing to a protected branch ('OngoingDev'), as expected. However, over HTTP it is possible.

Please see sequence of commands below:

$ git remote show origin

  • remote origin Fetch URL: [email protected]:root/eXXX2.git Push URL: [email protected]:root/eXXX2.git

$ git push Counting objects: 5, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 286 bytes, done. Total 3 (delta 0), reused 0 (delta 0) remote: FATAL: W refs/heads/OngoingDev root/exxx2 developer_local_host_1357780035 DENIED by refs/heads/OngoingDev$ remote: error: hook declined to update refs/heads/OngoingDev To [email protected]:root/eXXX2.git ! [remote rejected] OngoingDev -> OngoingDev (hook declined) error: failed to push some refs to '[email protected]:root/eXXX2.git'

$ git remote rm origin $ git remote add origin http://developer:[email protected]/root/eXXX2.git

$ git push Counting objects: 5, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 286 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To http://developer:[email protected]/root/eXXX2.git ec869b0..fee0e17 OngoingDev -> OngoingDev

... and the changes are in.

Assignee
Assign to
Time tracking