nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Branches not being tracked after removing jar file #366

Closed Teddayz closed 1 month ago

Teddayz commented 1 month ago

I referred to the bot feedback and it told me to remove my jar files from my remote repository. Initially, I created a randomFolder to test the jar file but I forgot to add it to the .gitignore.

I ran the command git filter-repo --path randomFolder/data/meeks.jar --invert-paths This removed all the meeks.jar files from all the previous commits that I had.

However, when I refreshed the IP Dashboard this morning, all my branches are now red instead of green. image Furthermore, I didn't cant go back to the previous version already and did not save into another repository.

image I have my remote branches still on github

Prior to this, all my branches were correctly tracked. Will I be marked down for the IP my branches are still red? How do I proceed?

damithc commented 1 month ago

@Teddayz Looks like something went wrong with your branches. Not to worry. We should be able to figure this out and rectify in due course. At the top of the iP progress dashboard, there are a couple of tips about troubleshooting when an increment related to a tag or a branch is not green as expected. See if those help you locate the problem. You can also post your git version graph here so that others can get a better context.

Teddayz commented 1 month ago

Hello, this is my version graph when I type in git log --graph --oneline

image

Referring to the tips for troubleshooting, my current branches look like this. I have went to some individual branches and pulled from the remote repository. Then, I removed the jar file before committing and pushing back to the branch. image Im afraid to merge it to my current master branch as it might mess up my finished IP.

damithc commented 1 month ago

I ran the command git filter-repo --path randomFolder/data/meeks.jar --invert-paths This removed all the meeks.jar files from all the previous commits that I had.

In other words, all those commits became new commits, different from the commits in your fork. Hence, the version of the branch in GitHub is no longer considered as merged to your master (that is why the Ahead number in the second screenshot is not zero for those branches, as mentioned in the troubleshooting guide)

damithc commented 1 month ago

One option is to force the branches in the fork to follow your local corresponding branch. For each branch, you can git push -f origin BRANCH-NAME e.g., git push -f origin branch-A-UserGuide to overwrite the branch in the fork with the one in the local repo. You can try with one branch first, and wait to see if turns green after the next dashboard update.

Teddayz commented 1 month ago

Could I merge each branch to my master branch and merge the conflicts as well?

Teddayz commented 1 month ago

I have went to each individual branch and ensured that they are the latest version before pushing the branch again to the remote repository. Then I went to master branch and merged them 1 by 1 whilst resolving the merge conflicts. This ensured that all my branches are merged to my master branch.

image Now my commits have the second number as 0.

Does this solve the problem? Waiting to check for the IP dashboard tomorrow.

damithc commented 1 month ago

@Teddayz Looks like branches are green now?

Teddayz commented 1 month ago

Yep, all branches are green now. Thank you for your help prof!