r/github • u/SyntheticScreams • 12d ago
Question How to replace all files on my repo with new files?
Sorry if this is really stupid. I know very little about how any of this works. I just don't want to manually delete and re-upload everything.
Explanation: I've been using GitHub pages to host the website I do my writing on, since having full control over every element of the site is really important to me. (I'm a writer, not a coder! I've been mostly winging it and googling everything as needed.) I've also been using an online html viewer to see my changes as I make them, and just copy-pasting into github when I'm done. But changing lots of pages at once is really annoying, and relying on a site that doesn't auto-save has bit me once or twice, so I decided to switch to VSCode.
But VSCode's live viewer doesn't work unless the code is locally hosted. So I downloaded and imported my website, made a ton of changes, saved everything... and realised I didn't know how to just mass-replace everything. Deleting every file one by one and reuploading seems to be the only solution. Doing this once is not a big issue. But if I ever want to make a lot of changes all at once, then I'd have to do it all again. And this is going to happen, because for every new chapter I release, I, at minimum, have to update:
- The page for the chapter itself
- The 'next chapter' button on the previous page
- The table of contents for that story
- The front page, announcing the chapter
And also probably 5. A new blog post and 6. The index for all my blog posts.
Updating six pages all at once and making sure they're in sync has gotten too much to handle. I'd be fine with anything that allows me to just delete and replace it all, or any solution that allows me to view my code as I'm writing it without hosting the files locally. Thanks for your help!

