1

We have a situation where there are 3 developers working on 3 feature branches. All three developers contributed to a single CSS utility file. Now we are in a situation where the features are incomplete but we need to sync just this utility file across all 3 branches because none of the features can be completed with out the merged file.

What should have happened is that the utility file should have been completed on its own feature branch then merged back in, and they the 3 branches would branch from that point in time but that didnt happen unfortunately.

Is there a way to sync a single file across branches?

2 Answers 2

1

Checkout master, and make a new feature branch.

Make a commit containing only the utility file

Merge that into each feature branch

Sign up to request clarification or add additional context in comments.

Comments

0

You don't sync files to keep feature branches up to date. You add commits to the base of the branch. The proper way to do this is with a rebase.

Make the change in one place on the branch that all three feature branches are based on. Then, you can individually rebase the feature branches.

$ git checkout feature_one # switch to branch $ git rebase original_branch 

This will remove all the commits the dev has made to the feature branch since it was created, add your commit from the original branch, then re apply all the feature's commits again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.