How to block git to push initial master behind sudo

I wish I could not accidentally push mastery, so I find it best to block git push origin master

if I don't have sudo privileges. Is there an easy way to do this? I would still like to push to other branches without entering a password on GitHub.


source to share

1 answer

Another approach would be to have two GitHub repos on two different accounts.

  • one represents the master branch
  • the other is a fork of the first and represents whatever branch you want

Working with a second repo (with a second account) means you can't push to the first.



All Articles