Friday, September 25, 2026

How to propagate changes from one branch to other branches of the team?

Now let's say I create a setup script for the project (I am product owner) and there are 5 developers working in five branches. How do I pass on my changes?

ChatGPT said:

Yes. In your situation, you should also work on a branch, even though you're the Product Owner.

The cleanest approach is:

main
  │
  ├── dev-1-task
  ├── dev-2-task
  ├── dev-3-task
  ├── dev-4-task
  ├── dev-5-task
  │
  └── setup-script   ← your branch

Your setup-script workflow

Suppose you create:

Bash
git checkout main
git pull
git checkout -b setup-script

You add:

setup.ps1
README.md
.env.example
requirements.txt
...

Then:

Bash
git add .
git commit -m "Add project setup script"
git push -u origin setup-script

Now you have a few options.

Option 1 — Recommended: merge your setup branch into main

If your setup script is independent of the developers' work:

setup-script
     │
     ↓
    main
     │
     ├── dev-1
     ├── dev-2
     ├── dev-3
     ├── dev-4
     └── dev-5

Once your PR is merged into main, the developers can bring your changes into their branches:

Bash
git checkout dev-1
git pull origin main

Or, if you want to be more explicit:

Bash
git fetch origin
git merge origin/main

Now Developer 1 gets your setup script.

The other developers do the same.


Option 2 — If you don't want to merge into main yet

You can merge your branch directly into each developer's branch:

setup-script
    │
    ├────────→ dev-1
    ├────────→ dev-2
    ├────────→ dev-3
    ├────────→ dev-4
    └────────→ dev-5

For example:

Bash
git checkout dev-1
git merge setup-script

Then:

Bash
git checkout dev-2
git merge setup-script

etc.

But I wouldn't recommend this as your normal workflow, because now your setup changes have to be manually propagated to five branches.


An even better team workflow

If you have 5 developers working simultaneously, I'd consider having an integration branch:

                    main
                      │
                      ↓
                   develop
                      │
       ┌──────────────┼──────────────┐
       ↓              ↓              ↓
    dev-1           dev-2          dev-3 ...

You create your setup changes:

main
 │
 └── setup-script

Merge:

setup-script → develop

Then developers periodically update their branches from develop:

Bash
git checkout dev-1
git fetch origin
git merge origin/develop

This gives you:

main = stable/releasable code

develop = current team integration

feature/* = individual developer work


One thing I'd strongly recommend

For a setup script, don't make developers copy/paste your changes manually.

Put the script in Git:

project/
├── setup.ps1
├── setup.sh
├── README.md
├── .env.example
├── src/
└── ...

Then the repository itself becomes the source of truth.

A developer can simply do:

Bash
git clone <repo>
cd project
.\setup.ps1

And when you improve the setup script later, they can get the updated version through Git.


For your specific situation

Since you're the PO and the 5 developers are already working on branches, I'd use:

main
  │
  └── develop
       │
       ├── feature/dev1
       ├── feature/dev2
       ├── feature/dev3
       ├── feature/dev4
       ├── feature/dev5
       │
       └── setup-script

You don't need a special "PO branch." Your setup script is simply another piece of work, so treat it like a normal feature/change and merge it into the team's integration branch.

If the setup script is very small and independent, I'd actually merge it to main and have everyone pull main. That's simpler than introducing develop just for this.

No comments:

Post a Comment