デフォルトブランチをdevelopに変更
- SettingsタブのDefault branch欄で矢印押下
- 確認ダイアログのdevelop選択、Update押下
- 確認ダイアログのI Understand, update the default branch押下
develop/masterへの直pushの禁止
- Settingsタブの左メニューのBranches押下
- Add classic branch protection rule押下
- Branch name patternにdevelop入力、以下をチェックしてCreate押下
- Require a pull request before merging
- Do not allow bypassing the above settings
- Restrict who can push to matching branches
- Restrict that create matching branches
- Add rule押下
- Branch name patternにmaster入力、developと同じものをチェックしてCreate押下
自分のPRを自分でdevelopにマージできるようにRequire approvalsはチェックしていない
直push禁止の確認
git clone https://github.com/XXX/XXX.git
cd XXX
git checkout -b temp-branch
echo "XXX" > dummy.txt
git add .
git commit -m "XXX"
git push origin HEAD:develop
git push origin HEAD:master
pushがエラーになればOK