简体   繁体   中英

Git and parallel branches

I am using git and I have a local develop branch, from which I created new branch called BranchA , where I will work on FeatA . I worked on this feature, and I needed some additional input, so I needed to postpone work until I receive information I required. So I committed to BranchA , and created new branch BranchB from Develop branch. This resulted in having two parallel branches created from Develop branch.

Now I received additional information for FeatA , so I reverted to BranchA , and finished FeatA. At this point I merged Develop branch with BranchA, pushed it to origin/Develop, and now I wish to continue developing on BranchB.

Do I need to "rebase" BranchB, so that its now based on "new" Develop branch, the one that contains FeatA also? If yes, how do I do it?

Need to? No. Why would you? If there are conflicts you can solve them when merging. If you need the features of BranchA in BranchB, then you can do this by (squash-)merging or rebasing (or even cherry-picking).

Have you pushed you BranchB to a remote? If so, you should not rebase your branch, unless you know what you are doing.

You might want to get a better understanding of how git works. I recommend the git book

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