Hi, you should use Github or Azure DevOps to manage your project.
Before publshing to the environment, the developer should meger the changes of source code.
Or, you separate their development environments and end up with a manual Merger, which of course is highly not recommended.
Hope this will help.
Thanks.
ZHU