How do I see what branches I have access to push to? I just accepted an invitation from our admin to a GitHub project and switched to the branch where my code was
localhost:myproject davea$ git checkout unit_tests_20180116
Switched to branch 'unit_tests_20180116'
but when I try and push my changes, I get an error saying I'm not authorized to push to the branch.
localhost:myproject davea$ git push origin master
Username for 'https://github.com': myusername
Password for 'https://myusername@github.com':
Counting objects: 54, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (48/48), done.
Writing objects: 100% (54/54), 101.02 KiB | 0 bytes/s, done.
Total 54 (delta 12), reused 0 (delta 0)
remote: Resolving deltas: 100% (12/12), completed with 5 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: You're not authorized to push to this branch. Visit https://help.github.com/articles/about-protected-branches/ for more information.
To https://github.com/CaravanTransit/myproject.git
! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to 'https://github.com/CaravanTransit/myproject.git'
How do I figure out what branches I am allowed to push to?
Edit: Here's what's listed in response to the output given. However, although "master" appears in the remote list, I'm still not able to push to it.
localhost:myproject davea$ git remote show origin
* remote origin
Fetch URL: https://github.com/CaravanTransit/myproject.git
Push URL: https://github.com/CaravanTransit/myproject.git
HEAD branch: master
Remote branches:
adding-tests tracked
admin-panel-fixes tracked
flexbox tracked
flexbox2 tracked
master tracked
rename-to-caravan tracked
Local branches configured for 'git pull':
adding-tests merges with remote adding-tests
master merges with remote master
Local refs configured for 'git push':
adding-tests pushes to adding-tests (up to date)
master pushes to master (fast-forwardable)