Score:0

How can I collaborate with multiple developers?

jp flag

I am developing a website on Drupal with 2 other developers. What would be the best way to collaborate? We plan to work on different git branches and there will be a dev and production branch as well. How can we keep in sync with the database structure without overwriting each others' work?

Kevin avatar
in flag
Everything important is in configuration. Use version control.
Score:1
aq flag

It can be done with Drupal's configuration management system. Have a read of https://www.drupal.org/docs/configuration-management to get started

Essentially any site changes apart from content can be stored in .yml files which you can import/export on each environment (storing them in GIT)

I wouldn't recommend trying to synchronize content and this is better done manually on your dev/stage/prod environment. But if you really wanted to there is the default content module which allows for content to go into .yml files too https://www.drupal.org/project/default_content

ABHISHEK Joshi avatar
jp flag
Wouldn't it cause merge conflicts? If I and a new content type and other developer adds new custom block type. When he pushes a commit and I import the config, won't it cause merge conflicts/overwrite my changes?
unusedspoon avatar
aq flag
No because each config e.g. content type, field, block.... are in separate .yml files. So if everything is new it's unlikely to cause any conflicts as you'll be adding/editing separate .yml files. The only time you'd have an issue is if you both edited exactly the same thing like the label for a field. In that case, you'd get a GIT conflict but you'd just have to sort those out like any code conflict
id flag
This is the correct answer. Merge conflicts are a part of life for developers but speaking from experience they are uncommon in configuration synchronization as long as you import the configuration on HEAD before working. The use-case in the question is the reason Drupal's configuration synchronization system exists.
ABHISHEK Joshi avatar
jp flag
Great. Thanks for explanation.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.