Can't push to GitHub master branch if protected

Issue #356 resolved
Kris Khaira created an issue

I'm having an issue where I can't push to a protected branch on master in GitHub.

I'm able to merge feature branch (e.g. feature/name-of-branch) into develop from PRs. But I can't pull the latest changes on develop locally (so I can tag them first), then push to master.

$ git push origin master
Counting objects: 1, done.
Writing objects: 100% (1/1), 231 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: 2 of 2 required status checks have not succeeded: 1 expected and 1 pending.
To github.com:touristly/tly-backend.git
 ! [remote rejected]   master -> master (protected branch hook declined)
error: failed to push some refs to 'git@github.com:touristly/tly-backend.git'

Output of git log --graph --online --decorate:

*   85067d2f (HEAD -> master, tag: v10.2.0) Merge branch 'release/v10.2.0'
|\
| *   a5ff5442 (origin/develop, origin/HEAD, develop) Merge pull request #474 from touristly/feature/sorting-tagged-trips-on-all-cobranded
| |\

I'm also attaching screenshots showing my setup.

Comments (2)

  1. Kris Khaira reporter

    It's ok I figured it out. I should've disabled "Require branches to be up to date before merging" in GitHub's protected branch settings for master. That option makes sense when merging feature branches into develop but not when merging develop into master.

    Unless I always want to make sure master is merged into develop first but that would clutter the log on develop with lots of "Merge branch release/..." commits.

    2017-02-24 at 1.10 AM.png

  2. Log in to comment