Git Branching – Is It Good Practice to Have a Remote Branch for Each Developer?

branchinggitversion control

Is it considered a good practice to have a remote branch for each individual developer in the project?

We're using Git with the following branches:

  • master
  • release
  • develop

If each developer had their own branch, they could push code into their branches and others could merge these changes into their own branches.

Best Answer

No! It is a good practice to have a remote branch namespace for each developer.

A single branch is often not enough, so the developer would either end up rewinding it a lot or it wouldn't be helpful much. You rather want to say that a developer can push whatever they want under their.name/. They can use it for publishing preview versions for others, giving version for somebody else to test or even for somebody else to integrate.

You can use this also for giving branches to integrator or you can use task-based names. The task-based names are usually easier to track for the integrator, but make developers think more about the naming and people don't like thinking. I don't know which will work better in practice; might even depend on the particular team.