Asumuri
Asumuri

Reputation: 11

Git - how to move master branch to other branch and head

Im doing for fun exercises on learnbranching. But im stuck on one of goals.

I have to move 'master' from one branch to another and force to move 'bugFix' to C0. starting point of exercise

I do get almost similiar effect, to goal where one branch is faded after:

git branch -f 

then

git branch -f master HEAD~2

How to move master, to C6 then?

goal on the left and my situation on the right

I think I know how to do the rest. When I'll find how to move master then I have to do only:

git checkout bugFix
git branch -f bugFix HEAD~3
git checkout C1

Any ideas?

Edit: I have found the solution.

1st

git branch -f master C6 

Then

git branch -f bugFix C0

And last

git checkout C1

Yes! It was that easy :D

Upvotes: 1

Views: 761

Answers (1)

Merc
Merc

Reputation: 4560

But anyway I just read that the command $ show solution will help you out. (Read here: https://github.com/pcottle/learnGitBranching/issues/109#issuecomment-25773762)

But I guess: #spoileralarm...

Upvotes: 1

Related Questions