0

We use pull-requests workflow for our projects. Each developer has own fork of a project. For example I have two repositories: upstream(main repo) and origin(fork of main repo). When I want to commit something I make a push to origin(my fork) and create a pull request from it to main repo.

Everything works great and it's a really good way to do code reviews but this is just a convention. Sometimes remote contractors do direct pushes to main repo(maybe it's just an accident:)).

Is there any explicit way to deny direct pushes to main repo?

Hooks don't help in this case because each developer can disable them

kharandziuk
  • 12,020
  • 17
  • 63
  • 121

1 Answers1

1

You can remove your remote contractors from the main repo's Collaborator list and make your contractors fork and let them create a pull request, just like what you are doing.

Also, please read this answer, it might help you.

Community
  • 1
  • 1
gmarintes
  • 1,288
  • 12
  • 16