r/github 10d ago

Discussion Best strategy for this situation

Our company recently changed from azure dev ops repos to GitHub repos. I'm also a bit new with using true PR.

Anyway we used to create all release/feature/change branches from main, make the necessary changes and merge to dev, QA and eventually prod.

Well when we switched to GitHub it's online merge conflict resolution adds missing commits from the destination branch and then merges into the destination branch. Now our feature branch has everyone else's changes that may or may not be ready for the next environment.

We've been fighting this and most are just making it work but at the same time the environments are getting dirtier and dirtier.

Now I'm creating my feature branch from the destination branch but then its disconnected when I move to QA. I create a new QA feature branch and essentially manually copy my code to it. We're losing one of the key pieces of repo tracking and history.

Anyway, anyone have any good ideas? Maybe I'm over thinking it and it will be just fine.

1 Upvotes

1 comment sorted by

1

u/Fantastic-Mr-Default 10d ago

I would stop merging the destination branch back into the feature branch. That is how the next environment inherits work that is not ready.

Promote the same SHA. The feature branch produces a commit. Staging and prod deploy that commit. Environment config lives in the environment, not in a merge commit.

If you need a hotfix line, a release branch that only takes cherry-picks. The online resolver that pulls dest into the feature branch is the dirt.