Am aware of how its done from the GitLab UI (http://gitlabdomain.com/ProjectNamespace/Project/protected_branches), but is there a way to "Protect" a particular branch from the command line?
Sure, you need a third-party command-line tool for that though, or use the REST API directly yourself.
Check http://www.rubydoc.info/gems/gitlab/frames which is listed on https://about.gitlab.com/applications/
You cant protect branch from the command line.
Git doesn't know how did you execute the command.
All the gui tools are executing git commands which are CLI behind the scenes.
So your answer is NO
What you can do might be able to pass special parameter along with the git lag commands -c
flag to any command and then check it in your server hooks to verify that the command came from GUI and not from CLI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With