By default, Gitlab has protection to force push to repository. It’s a good protection while collaborating with other peoples. But in this blog post, I’ll talk about how to break rules 🙂
Today by mistake our developer pushed important credentials to repository. It’s not nice to share secrets with everybody. We wanted momentarily to open force push.
If you want to do that also you have to change few things. All things are easy to perform, otherwise not easy to guess where is the correct button 🙂 So that I’ll want to share recipes of that steps which explains where they are 🙂
1 General push settings
- Main page right corner click Admin area
- Settings
- Visibility and Access Controls
- Change default branch protection
1.1 User role in repository(If Partially protected(Recommended))
- Go to project page which you want to change
- Click members from left menu
- Change member permission as Master
2 Branch protection
If there is a problem still this is the last thing that you have to do. Actually this well-hidden configuration.
- You must go to project page
- Click to project setting
- Protected Branches
- Click Unprotect master branch
After that settings, you can use push -f command (Be careful you can lose your data!). I am not the responsible person if it happens 🙂
Take care.