Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue Working on a sub branch while waiting a pull

Tags:

git

github

I have made my first pull request to a public github repo. I forked, coded and submited all my work on a branch. Lets call it BranchA.

While I am waiting on the request to go through I would like to do more work on a new branch that includes BranchA's changes. Should I create BranchB from BranchA?

If the above is correct when I pull the changes from the upstream what happens to BranchB assuming BranchA has been merged?

like image 976
McDonnellDean Avatar asked Apr 07 '26 16:04

McDonnellDean


1 Answers

Git doesn't have a concept of a "sub-branch"; branches don't have parents.

If you create branch B from branch A, branch B will include all of branch A's commits.
If you then make more commits in branch A, you can git merge (or rebase) them into branch B.
Similarly, if the upstream master gets more commits, you can git merge them into either branch (you'll need to git fetch them first).

When the pull request is accepted, the commits will then be in the upstream master as well.

like image 51
SLaks Avatar answered Apr 10 '26 10:04

SLaks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!