McDonnellDean
McDonnellDean

Reputation: 1087

Continue Working on a sub branch while waiting a pull

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?

Upvotes: 3

Views: 1027

Answers (1)

SLaks
SLaks

Reputation: 888233

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.

Upvotes: 3

Related Questions