Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

merges between different branches in GIT

malagathaz September 17, 2018

Hi,

I'm trying to know if it's possible in GIT for me to create 2 different branches from the master, then the branch A merges the changes onto the master, but it look like the branch B needs some of the changes branch A just merged, but alredy has some code itself, and doesn't want to lose it, is there some way to do this?

 

Thanks for your time

1 answer

0 votes
Stefan Kohler
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 Leaders.
September 17, 2018

Hi @malagathaz,

For my understanding, do you mean to following:

  1. From Master, create 2 branches (A & B)
  2. Work on Branch A
  3. Merge Branch A with Master to apply the changes
  4. Update Branch B with the changes pushed to Master?

You could accomplish step 4 also using a Merge, but now from Master to Branch B. Another option would be rebasing. There is actually a nice explanation of this available: https://www.atlassian.com/git/tutorials/merging-vs-rebasing

 

Hope this helps,
Stefan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events