Is it possible to require branch to be merged in one branch before another? #21578
-
If you have three branches (A, B, and Feature) and you want to merge Feature into Branch A, can you require Feature to be merged into Branch B first? I was thinking that something with actions would be the way, but I’ve never used it, so I’m not 100%. I’m open to other solutions though. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You could create a pre-commit hook that launches a script that will prevent merging Feature into A if it’s not en-par with B. But I would advise against such approaches, for they are most likely going to create problems, especially if you ever end up having to rewrite branches history. Since you’re dealing with just two branches, I suggest you keep doing it manually (which forces you to manually check their status), and if you really need to implement an automated solution, make it so that it’s an optional status check and that doesn’t handle these operations automatically. |
Beta Was this translation helpful? Give feedback.
You could create a pre-commit hook that launches a script that will prevent merging Feature into A if it’s not en-par with B. But I would advise against such approaches, for they are most likely going to create problems, especially if you ever end up having to rewrite branches history.
Since you’re dealing with just two branches, I suggest you keep doing it manually (which forces you to manually check their status), and if you really need to implement an automated solution, make it so that it’s an optional status check and that doesn’t handle these operations automatically.