DEV Community

Discussion on: Git + GitHub Best Practices for Teams (Opinionated)

Collapse
 
qaismakani profile image
Qais Makani

Recently, we've been facing issues where certain code merges were reverted from the develop branch. This led to other feature branches that were rebased from the develop branch contain code that isn't in the develope branch anymore. So when you try to merge that rebased feature branch to develop, the reverted code goes back in.

Is there any smart way to handle this? We're currently resorting to manually remove the reverted changes from our feature branches, which is prone to mistakes.

Collapse
 
bholmesdev profile image
Ben Holmes

Yeesh, that sounds like you'd have to walk through the commits within the child branches and peel out the commits that were reverted. Really haven't been in this situation tbh so I don't have a great answer other than to always use revert sparingly.

Any readers have suggestions?