Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Merge a branch from another branch in master


example.jpg


Following this picture:

  • I create a branch from master (Branch 1)
  • I push 3 commits.
  • I create a pull request on master.
  • Instead of waiting the branch 1 to be merged in master, I create a branch 2 from the branch 1.
  • I push 3 commits, meanwhile the branch 1 as been merged in master with the pull request.
  • I create a pull request for branch 2.

 

My questions are:

  • In my 2nd pull request, will l have only the 3 commits of the branch 2 or the 6 commits of the branch 1 and 2 ? Indeed, given that the branch 1 has been merged in master its 3 commits are no longer new in branch 2.
  • Same questions for the files changed in branch 1, will they appear in the pull request of the branch 2 even if the branch 1 has been merged in master ?

 

Hope this is clear enought. Thanks

1 Reply
Commander Lvl 2
Message 2 of 2

Re: Merge a branch from another branch in master

Hi @PierBJX,

 

Welcome to the Github Community Forum!

 


@PierBJX wrote:

My questions are:

  • In my 2nd pull request, will l have only the 3 commits of the branch 2 or the 6 commits of the branch 1 and 2 ? Indeed, given that the branch 1 has been merged in master its 3 commits are no longer new in branch 2.

If the branch1 are already merge into master, the changes made by the 3 commits of branch1 are now also in master. The master already have the 3 commits of the branch1 then the Pull Request for branch2 analyze only the 3 new commits made by himself.

 


@PierBJX wrote:
  • Same questions for the files changed in branch 1, will they appear in the pull request of the branch 2 even if the branch 1 has been merged in master ?

Simple no, for the reason explain above.

 

Hope this helps, ask if you have more questions.

 

-Gabriele-

 

Mark helpfull posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great contents!