pcottle / learnGitBranching

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
https://pcottle.github.io/learnGitBranching/
MIT License
30.11k stars 5.72k forks source link

Can someone explain to me about hint in level "Branch Spaghetti"? #1151

Open lizyeseul opened 1 month ago

lizyeseul commented 1 month ago

The hint says "Make sure to do everything in the proper order! Branch one first, then two, then three" and the answer is

git checkout one;
git cherry-pick C4 C3 C2;
git checkout two;
git cherry-pick C5 C4 C3 C2;
git branch -f three C2;

But doesn't it matter the order? ex.

git checkout two;
git cherry-pick C5 C4 C3 C2;
git checkout one;
git cherry-pick C4 C3 C2;
git branch -f three C2;
niluan304 commented 2 weeks ago

order is important,

look at the show goal, HEAD must be point to branch two.