简体   繁体   中英

I branched off an unmerged feature branch, but that unmerged branch has now been merged

I branched (call it C ) off an unmerged feature branch (call it B ), but that unmerged branch ( B ) has now been merged into develop ( A ).

Is it OK to keep working on C and when it is done, make a PR into A ?

Is this an OK practice in the future? Or should I really wait until B is merged before branching from A to create C ?

Yes, this is quite alright.

The commit in the feature branch you started your branch from is now an ancestor of the master branch head in the repository, so when you're done with that, it in turn can be merged in.

You might want to edit your .git/config and change the "upstream" branch setting for the branch you're working on to be master instead of the feature branch, but that is just for the convenience of git pull syncing from the right upstream automatically.

(If the feature branch you started off from was rebased after you branched, things are much worse, but hopefully that will not be the case).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM