The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I/Should I commit one set of changes to multiple branches?

Raymond DeGennaro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2015

I'm not sure the best way to handle this, but I think what I want to do is push one set of changes to multiple branches, or duplicate the most recent changes in multiple branches.

I have one project, that has three separate targets, that (currently) only differ in "branding" (icons, splash screens, messages, etc.) and version number.  I just made a large set of changes that only affected shared code, so I checked the changes into origin/master.  I'd like the same "snapshot" of code to be in each of the brand-specific branches.

  • Can I copy the last commit to origin/master to each branded branch?
  • Is my only choice to check-out the code and commit to each branded branch?
  • Can I do this a better way?

I'd like to do this using SourceTree (Mac), but I can use the Bitbucket web interface, or raw git commands, if necessary.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 27, 2015

I'm not entirely sure if this will work with your branching strategy, but the ideal solution would be to merge master into each other branch.

If there are other changes to master that you don't want to propagate to the other branches, you can check out each other branch and "cherry-pick" the commit in question (in SourceTree, right-click the commit you want to cherry-pick). http://git-scm.com/docs/git-cherry-pick

Raymond DeGennaro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2015

Ah, didn't think of merging out of master. This will work because there's no unique code between the versions, right now.

TAGS
AUG Leaders

Atlassian Community Events