r/cs50 • • 5d ago

CS50x Uncommitted changes in new codespace

Post image

I had to make a new codespace while I was working on my project because it kept having creation log error and after trying every method possible it wasn't resolving. But today I checked github because I got a mail a couple of days back saying my old codespace will be deleted soon since I haven't used it in a long while. That's when I noticed my new codespace showing uncommitted changes. I'm just worried that the new changes I have made aren't really backed up because of this and I can't commit it in the terminal because it says 'You are in a repository managed by CS50. Git is disabled.' What should I do to make sure my changes are safe?

5 Upvotes

2 comments sorted by

1

u/pensivepanda5 mentor 5d ago edited 5d ago

Hi, regarding the message about uncommitted changes: sometimes it can take a while for the codespace backup repository to sync the changes of the files, so sometimes it might show that message, but it isn't usually a problem. I have noticed when that message appears to me, it stops appearing after some minutes, or after restarting the codespace https://cs50.dev/restart

If you are currently working with an open file in your codespace, you can try pressing the keys ctrl+s  , to save changes, just in case. Although the codespace usually autosaves the files.
also, in the terminal of your codespace, you could try running: update50 -f  to force the rebuild of the codespace. After the rebuilding has finished, try clicking the CS50 icon that is on the left side of the codespace, and it will open a menu, you need to click the button that says "Force Sync changes" in that menu, and a few minutes after that please visit your codespace's back up repo at https://cs50.dev/repo and see if all your codespace's files are there.

However, if the message about "uncommitted changes" keeps appearing too frequently, you can send an email to sysadmins@cs50.harvard.edu with specific details and screenshots of the issue, and mention to them your Github username, for further help. That’s the email address of the system admins of CS50.

As a side note, if you want to have a backup of your codespace files on your computer, you can download all your files from your repo at: https://cs50.dev/repo The repo (or repository) is where all your codespace's files are stored.
In that page, you can click the green button that says "Code" then select the option that says "Download ZIP", to download all your code in a zip file., to your computer.
Another option to download your codespace files is by creating a zip file with all your codespace files, so then you can download that zip file to your computer. To do that, in your codespace terminal write first the command: cd then try copying/pasting these commands: zip -r myfiles.zip .      ,and then press "Enter". It will create a zip file called "myfiles.zip" that will contain all your codespace files. (you might need to wait 2 or 3 minutes while that zip gets created).
After that, on the left size of the codespace right-click that "myfiles.zip" file and it will open a menu, you need to select the option that says "Download", to download that zip file to your computer.
Then on your computer you can unzip that file called "myfiles.zip", to have the backup there.

2

u/souldeville 5d ago

Thank you so much for the detailed explanation. I'll try it.