Problem is described in the image as it was giving some error in the text.
I don't know why your question is being downvoted, because it's legitimate and very much a common mistake that beginner users make when using Git.
You accidentally created branch BR-02
from branch BR-01
. One solution is to create a branch using the correct base, and then cherry-pick any commits you have made on BR-02
onto this correct branch.
git checkout BS-00 # switch to the correct branch
git checkout -b BR-03 # create the correct branch using BS-00 as a base
git cherry-pick <SHA-1> # cherry-pick the commit from BR-02
Here <SHA-1>
is the hash of the commit on branch BR-02
which you wish to keep. You can find out this value by switching to BR-02
and typing git log
from the terminal.
Note that this is effectively merging the commit you made on branch BR-02
into the branch BR-03
, so there might be conflicts. Finally, you can delete the bad branch BR-02
since you don't need it anymore:
git branch -d BR-02 # delete the wrong branch BR-02 locally
git push origin :BR-02 # delete the wrong branch BR-02 on the remote
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With