GIT Question for company
Sorry if this is a really noob question, but I don't want to bother my manager and also I've never worked as a team on a Git project and never ran into this issue...
I have coded a branch1 on my company GIT repository.
After I have finished coding it, it is pending work review, so they haven't integrated it into master yet.
Now I have been told to code a new branch2.
However, now there are updates on main that are not in the branch1, and updates in the branch1 that are not in main.
I need both of these changes to update what I am doing in branch2.
What solution do I have apart from asking them to finish the pending work review and integrate branch1 to main and then pulling the new main from my side?
3 Replies
imho, merge/rebase main into branch1, then diverge branch2 from branch1.
you will need to rebase branch2 if there are any fixes/changes required to branch1, but seems like the simplest approach
ok, is that the usual approach? wouldn't branch2 in one way or another rely on branch1? they are 2 completely different functionalities and it would make the most sense to keep them as separate branches
I need both of these changes to update what I am doing in branch2.so how do you plan to work on branch2, that by above statement requires branch1, without branch2 containing the code from branch1? and to be clear, they would be separate branches. its just that if branch2 were to be merged before branch1, it would cause issues if you don't need the changes from branch1, just fast-forward main to the latest remote version, then branch out branch2 from main and get to work.