Git practise on cooperating project

Hi Robot Masters,

Could you please let me know your practise of using Git on cooperating projects? Our team wants to keep flexibility and make everyone engaged, so every developer can do Git Push and publishing to Orchestrator. And now I cannot figure out the relationship between Git Push and publish…

Case #1 - publish first: Developers A & B cloned the same version of Project X to their dev machines, then A started working on bug #1 and B started working on bug #2. A finished first; he published his X copy (contains fixes to bug #1) to Orchestrator and pushed his script changes to Git server. Then B finished his job; he published his X copy (contains fixes to bug #2) to Orchestrator and pushed his script changes (with merge) to Git server. Here is the problem - on Orchestrator there is no version contains both the fixes to bug #1 & #2.

Case #2 - push first: Developers A & B cloned the same version of Project X to their dev machines, then A started working on bug #1 and B started working on bug #2. A finished first; he pushed his script changes to Git server and published his X copy (contains fixes to bug #1) to Orchestrator. Then A found that the project.json is changed due to publish, so he had to push again for the project.json. Then B finished his job; he pushed his script changes (with merge) to Git server and published his X copy (contains fixes to bug #1 & #2, since B merged the codes) to Orchestrator. B also had to push again for the project.json after publishing. This looked fine however it needs developers to take a series of actions which is error prone.

Case 2’ - push first with interruption: Developers A & B cloned the same version of Project X to their dev machines, then A started working on bug #1 and B started working on bug #2. A finished first; he pushed his script changes to Git server, then he got a phone call that interrupted his publishing. Meanwhile B finished his job; he pushed his script changes (with merge) to Git server and published his X copy (contains fixes to bug #1 & #2, since B merged the codes) to Orchestrator, and push again for the project.json. Then A returned from his call, continued his publishing. Here is a problem - the latest version on Orchestrator contains fixes to bug #1 only.

Sorry to make this long…your suggestion is appreciated!