Can I specify a specific branch on GitHub pull-only (read-only)?

Is there a way to set a specific branch on GitHub to pull-only (read-only) or can I only set this for the whole repository?

  • git submodules not updating in Jenkins build
  • Checking out Git tag leads to “detached HEAD state”
  • Github: how to fork after cloning?
  • how to get trunk code from repository? (redmine,svn)
  • Git add . failing on subdirectory that has a .git folder, even though being ignored
  • How to collaborate on a project with Xcode Storyboards?
  • Reset Git repository permission
  • Git - Ignore certain files contained in specific folders
  • File Appear on Untracked list Git Commit but not on Git Status
  • How to use GIT interactive rebase for signing off a series of commits
  • File mode with msysgit
  • Git add: Why do I have to manually specify which files to commit?
  • 3 Solutions collect form web for “Can I specify a specific branch on GitHub pull-only (read-only)?”

    There is no way to do branch level permissions on Github, but the gitolite project supports what you’re looking for.

    You actually can (sort of), since September 2015.

    That is because you now have “Protected branches and required status checks” (September 3, 2015), which allows you to protect a branch:

    • against forced pushed
    • against deletion
    • against merged changes until required status checks pass

    As mentioned in the twitter discussion:

    @github nice, what about protect from just push and allow only operating through pull requests?

    Adam Roben ‏@aroben @lowl4tency You can do this via the Status API:
    create a “success” status only on commits in PRs, then mark that status as required

    Since Nov. 2015, you can protect a branch with the API:

    curl "" \
      -XPATCH \
      -H 'Authorization: token TOKEN'
      -H "Accept: application/vnd.github.loki-preview" \
      -d '{
        "protection": {
          "enabled": true,
          "required_status_checks": {
            "enforcement_level": "everyone",
            "contexts": [

    How can I try it?

    To access this functionality during the preview period, you’ll need to provide the following custom media type in the Accept header:


    Since March 2016, Organizations can now specify which members and teams are able to push to a protected branch.

    Starting from March 30th 2016, GitHub does support branch permissions without any further tricks like required status checks:

    Git Baby is a git and github fan, let's start git clone.