nus-cs2113-AY2324S2 / forum

2 stars 0 forks source link

Local Commits on New Branch #5

Closed JianJiaT closed 4 months ago

JianJiaT commented 5 months ago

image

I received an error when attempting to push my local code to my GitHub repo ("Updates were rejected because the tip of your current branch is behind its remote counterpart"), and when I fetched from the GitHub repo it appears that my local commits are on a new, different branch from my GitHub repo. I tried to checkout at origin/master and merging my first local commit, but it failed as they were unrelated histories. How did this issue arise, and how would I fix this issue?

okkhoy commented 5 months ago

Not sure how you ended up in this state. Can you give the screenshot of SourceTree commit history with all branches shown?

JianJiaT commented 5 months ago

image Not sure how to make the commit history bigger, but I can scroll down all the way to find the initial commit of the remote branch

okkhoy commented 5 months ago

Sorry, can't make much sense. Please ping me on MSTeams to continue the triaging.

JianJiaT commented 4 months ago

Solved with the help of prof, turns out I cloned to the wrong folder