![]() Mukadi on How to Password Protect GRUB Boot Loader in Ubuntu 20.04 LTS.gabriel on Solved "WslRegisterDistribution failed with error: 0x80370114".Solved: "Kubectl error: You must logged in to the Server (Unauthorized)".How to Install and Use crictl on Linux Using 10 Easy Steps.How to Install Juju Client on Ubuntu 20.04 LTS (Focal Fossa).How to Install pg_dump and pg_restore on macOS Using 7 Easy Steps.How to Install pg_dump and pg_restore on Ubuntu 20.04 LTS (Focal Fossa).How to Install Mojo on Ubuntu 20.04 LTS (Focal Fossa).Solved "pg_restore: error: input file appears to be a text format dump".How to Install TablePlus on macOS Using 5 Easy Steps.How to Tag a Git Commit Using 6 Simple Steps.How to Rename a Tag in Git Using 10 Easy Steps.Please let me know your feedback in the comment box !! Categories DevOps, Git ! master -> master (protected branch hook declined) error: failed to push some refs to the above article helped. To git+ssh:///cyberithub/atlantis-example.git Remote: error: Cannot change this locked branch Remote: error: GH006: Protected branch update failed for refs/heads/master. Remote: Resolving deltas: 100% (1/1), completed with 1 local object. This confirms that branch protection rule is working as expected and users are now not allowed to push to master branch. Now if you try to push any changes to the remote master branch then you should end up with below output. Then you need to click on Create to finally create this branch protection rule. If you would like to prevent even administrator or anyone with bypass branch protections permissions to push any changes to master then you need to check mark one more option called Do not allow bypassing the above settings as well as you can see below. However it is important to note that this protection rule would not prevent administrators or anyone with bypass branch protections permissions from pushing any changes to master branch. You can also check mark the Allow fork-syncing option in case you want the branch to pull changes from its upstream repository. Then check mark the Lock branch option to prevent users from pushing changes to this branch. Here you need to provide master branch under Branch name pattern. You will see an option called Add branch protection rule under Branch protection rules section. Then you need to go to Branches section on the left side as shown below. In the repository, you need to click on Settings as highlighted below. In our case, we are using a sample repository called atlantis-example. ![]() You need to first visit the GitHub login page and enter your valid credentials to login to your account as shown below.Īfter successful login, you need to go to your Repository as highlighted below. How to lock master branch in GitHub Using 3 Easy StepsĪlso Read: Solved: "error: failed to push some refs to remote" Step 1: PrerequisitesĪ) You should have a valid GitHub Account.Ĭ) You should have access to create Branch Protection rule in the given repo. We will see the steps to lock the master branch by creating this rule in the below section. This can be easily done through a feature provided by the GitHub called Branch Protection Rule. So any user who is using GitHub to manage their project code would first be looking to protect its repo master branch from any accidental commit by the developers or programmers working on that specific project. It provides excellent web based interface to manage repositories and their branches. ![]() GitHub is a famous git based repository hosting service used by millions of users around the world. I am pretty sure whenever you plan your branching strategy, the first priority is always given to protect the master branch from any mishap as this branch is usually used for deployment in production as well as a reference for any feature addition or code changes. In this article, we will see how to lock master branch in GitHub repo and prevents users from pushing any changes to the branch. ![]()
0 Comments
Leave a Reply. |