Watts-College / cpp-528-spr-2022

https://watts-college.github.io/cpp-528-spr-2022/
0 stars 0 forks source link

Github desktop error after deleting a file #15

Closed Johaning closed 2 years ago

Johaning commented 2 years ago

(Somehow I just posted this on a cpp-528-template page instead of here, sorry!)

I did what I now realize was a dumb move and hopefully have not broken everything permanently! Working locally in my branch on the lab, I saved my lab .Rmd file that had all my code working through the tutorial, and then renamed and saved-as to delete out the unneeded tutorial code to submit. Both version were saved in my local folder, and then I saved the version with unneeded code into a different folder and deleted it from the project lab folder.

Now github desktop is giving me an error that says "fatal: missing object 417d68e3e56ae5edaf7484caa3aa9275b2094afb for refs/heads/main." I tried saving the deleted file back into the folder, but anything I do in github desktop just generates that same error message. I was able to commit my branch.

How should I handle this? I'd still like to get rid of that unneeded .Rmd file, but also to make sure things work and not have github desktop shouting "Fatal" at me. And for future reference, is there a way that I could have saved that unneeded version of my file without causing this mess? Thank you for any help!!

yukicruz commented 2 years ago

I normally use the Terminal in RStudio for Git and to interact with GitHub for CPP528. While the Command Prompt in GitHub Desktop would likely achieve the same level of interaction, I imagine the GUI of GitHub Desktop will have limitations in resolving that problem.

The error shouldn't be too problematic if you can ignore it for the rest of the course. I figure it is more of an eyesore than an actual problem.

If you are adamant about clearing out the error, first determine: Was your branch committed, pushed to the repo, and then successfully merged to main? If so and you're okay with your local branch mirroring the repo main, consider running a "git merge main" command. You may have to do some preliminary setup (i.e., this and that (referenced here) for that to work if upstream isn't properly configured yet.

Regarding your question on how to avoid the mess in the future:

Johaning commented 2 years ago

@yukicruz, thanks for the reassurance that this didn't completely destroy our whole project, and the pointers!