1

My team has a main branch and a dev branch. When pushing anything, we create a new branch, make changes to the feature branch, merge the main branch (git pull) and then create a pull request for our dev branch. Once it's approved, the user can merge it and then it is tested on dev. After that, we create another pull request from the same branch for main.

Recently, we saw some changes were pushed to main without being pushed on dev, and we had to back-merge every time. Is there a way to check if the current commit (SHA) is on dev, and if it is not, then we don't let the user create a pull request for main (or merge the pull request to main)? I understand that in some cases, we might have to create different commits for main and dev, and in that case, this condition won't be satisfied (in which case we will let the administrator decide).

torek
  • 448,244
  • 59
  • 642
  • 775

0 Answers0