Answer the question
In order to leave comments, you need to log in
Is it possible in GIT to change the parent of the very first commit in a branch (change the original branch)?
Hello!
There is a branch, let's call it branch-B, and a branch branch-A. branch-A is based on master, and branch-B is based on the latest commit of branch-A. Now, is it possible to make branch-B change its genealogy and make it look like it was created from the master branch?
I would be grateful for advice, thanks.
Answer the question
In order to leave comments, you need to log in
Found a solution.
To change the parent branch from which the branch we need to branch to master, you need to execute
Instead of ~2, there can be any desired number (the number of commits in the branch + 1) to shift the pointer to the last commit in master. After that, you can safely make any other commit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question