We have gitlab 10.2.8 CE. Have created a project having 2 branches (Master, Dev).
Set the Master branch as protected and enabled only Masters to push and merge the code.
Added a user to the repo with developer role. When he makes any commit on the master branch through Gitlab UI, it commits by creating a patch1 that can be merged to master. This is the expected behavior.
When the user uses git client like git cmd or git bash. The developer clones the repo and makes changes to the file. He then does a commit and push through client and it gets updated in the master branch.
Expected behavior: He should not be able to push to master branch from git client as well.