Github Desktop says my own local branch is "a protected branch" and I can not commit to it. How do I remove this protection?

Viewed 446

I forked a Project on GitHub and then opened my fork in GitHub Desktop (Windows 7). Locally, I created a branch and made changes to the code. Now I want to commit the changes, then publish the branch to my fork on GitHub, and then make a pull request to the original repo. That is how it used to work the last time I did this.

But now GitHub Desktop unasked protects this branch ("branch is a protected branch. Want to switch branches?"), and I can not commit things to it. On GitHub, in the settings of my fork, under "Manage Access", it says:

0 collaborators have access to this repository. Only you can contribute to this repository.

But I can not do this (contribute to this repository).

How can I "unprotect" that branch and commit to it?

1 Answers

The solution was to first push the fresh branch without the commits to my fork at GitHub. After that the protection in GitHub Desktop disappeared, and I was able to locally commit changes to that branch and push them online.

I had to log off and log in once from within GitHub Desktop, to be able to push the branch, for security considerations, I had not logged in via Desktop for a while.

Related