0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHubのデフォルトブランチの変更およびdevelop/masterへの直pushの禁止

Posted at

デフォルトブランチをdevelopに変更

  1. SettingsタブのDefault branch欄で矢印押下
  2. 確認ダイアログのdevelop選択、Update押下
  3. 確認ダイアログのI Understand, update the default branch押下

develop/masterへの直pushの禁止

  1. Settingsタブの左メニューのBranches押下
  2. Add classic branch protection rule押下
  3. 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
  4. Add rule押下
  5. 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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?