# Github protected branch

**URL:** <https://discuss.circleci.com/t/github-protected-branch/1121>\
**Category:** Bug Reports\
**Created:** [December 15, 2015, 2:58am UTC](https://discuss.circleci.com/t/github-protected-branch/1121 "2015-12-15T02:58:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkschan](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mrkschan/32/743_2.png) [@mrkschan](https://discuss.circleci.com/u/mrkschan)\
**Post date:** [December 15, 2015, 2:58am UTC](https://discuss.circleci.com/t/github-protected-branch/1121/1 "2015-12-15T02:58:26Z")

</div>

I have setup my Github repo to use protected branch and turned on the settings that requires circleci status check. I found that whenever my Pull Request branch is having some missing commits from the master branch, Github does not allow me to merge my Pull Request branch to master even there’s no conflict at all. Is this the expected behavior that my Pull Request branch needs to be always “synced” with the master branch before merging?

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [December 15, 2015, 3:02am UTC](https://discuss.circleci.com/t/github-protected-branch/1121/2 "2015-12-15T03:02:56Z")

</div>

This is a question you may have to ask GitHub.

CircleCi only tells Github if the build passes or fails, it is up to GitHub to decide if you can then merge or not.

Ref: [https://help.github.com/articles/defining-the-mergeability-of-pull-requests/](https://help.github.com/articles/defining-the-mergeability-of-pull-requests/)

---

<div class="post-metadata">

**Author:** ![mrkschan](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mrkschan/32/743_2.png) [@mrkschan](https://discuss.circleci.com/u/mrkschan)\
**Post date:** [December 15, 2015, 8:50am UTC](https://discuss.circleci.com/t/github-protected-branch/1121/3 "2015-12-15T08:50:30Z")

</div>

Thx @drazisil, I got a reply from Github and see if this can help other circleci users.

> The behavior you observed is indeed expected. When required status  
> checks are enabled for a branch, pull request made to that branch have  
> an additional requirement – the source branch must be up to date with  
> the target branch (master in your case). This helps you feel more  
> confident that your tests will pass not only for your branch, but also  
> when you merge your branch into the target branch. If the source branch  
> is behind the target, that means there are some commits there that are  
> not in the source branch which might affect CI tests. For that reason,  
> the merge button will be disabled and you’ll be shown an Update branch  
> button which lets you merge the target branch into the source.

> That said, the team is considering adding configuration options so that  
> you can decide if you want to turn on this requirement or not (but I  
> can’t promise if/when this might happen).

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [December 15, 2015, 9:02am UTC](https://discuss.circleci.com/t/github-protected-branch/1121/4 "2015-12-15T09:02:46Z")

</div>

Thank you very much for sharing! 😄

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:31am UTC](https://discuss.circleci.com/t/github-protected-branch/1121/5 "2018-06-18T11:31:53Z")

</div>

Closed on June 18, 2018, 11:31am UTC


