I tried pushing a change last night and got an error that I haven’t seen before, and cannot figure out what is going on. Has anyone seen something like this or know how to debug or fix this issue?
$ git push origin HEAD:master
Username for ‘https://github.com’: teresajohnson
Password for ‘https://teresajohnson@github.com’:
Enumerating objects: 33, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 56 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 2.10 KiB | 2.10 MiB/s, done.
Total 17 (delta 14), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (14/14), completed with 14 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://docs.github.com/articles/about-protected-branches/ for more information.
To https://github.com/llvm/llvm-project.git
! [remote rejected] HEAD → master (protected branch hook declined)
error: failed to push some refs to ‘https://github.com/llvm/llvm-project.git’
I retried several times and keep getting that. I can log into github with the same username and password, and I see there that I am a member of llvm, can see llvm-project, and am a member of “LLVM Committers”.
Someone suggested I try using SSH, so I set that up following the directions at https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh.
I confirmed I can ssh to github now. I changed my remote’s URL to SSH:
$ git remote set-url origin git@github.com:llvm/llvm-project.git
$ git remote -v
origin git@github.com:llvm/llvm-project.git (fetch)
origin git@github.com:llvm/llvm-project.git (push)
However, I am still seeing the same error:
$ git push origin HEAD:master
Warning: Permanently added the RSA host key for IP address ‘140.82.112.4’ to the list of known hosts.
Enumerating objects: 33, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 56 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 2.10 KiB | 1.05 MiB/s, done.
Total 17 (delta 14), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (14/14), completed with 14 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://docs.github.com/articles/about-protected-branches/ for more information.
To github.com:llvm/llvm-project.git
! [remote rejected] HEAD → master (protected branch hook declined)
error: failed to push some refs to ‘github.com:llvm/llvm-project.git’
What am I doing wrong?
Thanks,
Teresa