Reputation: 247
I have Branch a branch A checked out from master branch.then i have a branch B Checked out from branch A .
I want to change the parent of branch B to master
Current Tree
master
/
A
/
B
Should Be
master
/ \
A B
Upvotes: 5
Views: 6802
Reputation: 113
You can use this command to change your parent branch:
git rebase --onto new_parent_branch old_parent_branch
In your case, use these commands:
git checkout B
git rebase --onto master A
Upvotes: 5