nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Accidentally created a branch off another branch instead of master #251

Closed vinceg4 closed 1 month ago

vinceg4 commented 1 month ago

While doing this week's iP task. I seem to have accidentally created another branch off another branch. This led to this outcome which does not seem to match the ones shown in the project task:

image

Based on the picture it seems like I created branch-A-Assertions off of branch-A-CodeQuality but checking my git bash history, it seems to be the other way round:

image

(ignore branch-A-Streams because I deleted it) What is the appropriate way to fix this issue given that I have already pushed some of the branches into my remote repo?

damithc commented 1 month ago

@vinceg4 You are encouraged to try to fix it but it's not required. Just be more careful in future, as this is a common branching mistake.

nus-se-bot commented 1 month ago

Tagging a few other students (randomly selected) who have completed related increments, in case they can pitch in: @casperngeen @sumomomomomo @fusin02 @chiangqinkang @zaidansani @tansanchian @engyuhan @GabrielCWT @Feng1231 @Zenkoh1 Others are welcome to pitch in too.

GabrielCWT commented 1 month ago

Normally I would not recommend trying to fix it since it is pushed upstream. (Other people might be working on it) But since this repo is just for you.

  1. Reset branch-A-CodeQuality's HEAD by 1 (Undo merge of master)
  2. Reset master's HEAD by 2 (Undo merge of branch-A-CodeQuality and branch-A-Assertions into master)
  3. Rebase branch-A-Assertions to the commit with tag A-Checkstyle (Makes the 2 branches parallel)
  4. Merge the 2 branches into master
  5. Force push
nus-se-bot commented 1 month ago

@vinceg4 A gentle reminder to close this issue if the problem has been resolved. If not resolved yet, please post a comment explaining which part of the problem/question remains unresolved.