1. 管理員身份登陸GitHub,找到項目
2. Settings-->Branches-->Protected branches--->Choose a branch... ,選擇須要保護的分支,而後點擊edit按鈕,
3. Branch protection for 所選的分支名 --> 勾選Restrict who can push to this branch People and teams with push access
若不選擇任何人,則任何人都沒有push代碼到該分支的權限。this