Assume a scenario where I have a repo and there are 3 branches, master - where all the deployment code lives, and two feature branches A and B which are being used by different developers and have commits that can't be discarded. Suppose there is a bug that is affecting the work on branch A and branch B. What will be the ideal way to complete this task? What I've been doing is creating a 3rd branch 'C', implementing the fixes, and then merging it with the master, pushing it to the origin, pulling the changes on the devs' machine, and merging the branches A and B with the master. But it seems it isn't the ideal way to do it. It somehow feels really jank. Is there a better way to do it?
Also, if there are some pro tips for newbies like me, please shower us with your wisdom.