Reputation: 2494
I would like to know which is the best approach for doing this. I'm curently working on a new design, the old design is still in production and a few bugs came up. So I decided to create a new branch called "old" and fix the bugs there so I can upload the fixes without breaking the design. What happens when the new design is ready and I want the fixes to be applied to the master branch? Which branch merges into which? How do I tell git which files to merge? I don't get it. Thanks.
EDIT: What I think I need is to commit changes in the old branch and replicate them in the master branch. Is that possible?
Upvotes: 0
Views: 228
Reputation: 26968
You can do it in two way, merging or rebasing
for merging
git checkout master
git merge old
then everying in the old branch will be in master branch. but for the old branch, it doesn't have all the things in the master branch if you want to keep 2 branches in sync , you need to
git checkout old
git merge master
Upvotes: 1
Reputation: 1931
You need to checkout master Branch (where you developed the new design) and merge "old" into your branch you have checkout.
In case you just want specifig file(s) you may ether use checkout from other branch or cherry-pick a commit.
checkout from other branch: see the accepted answer from this so question
cherry-pick: see the accepted answer from this so question
Upvotes: 0