Uploading to GitHub when there is a unique client ID for an API

Hi, this query has come about after completing the Jammming project https://www.codecademy.com/journeys/front-end-engineer/paths/fecj-22-front-end-development/tracks/fecj-22-react-part-ii/modules/wdcp-22-jammming-b26fb9a6-a249-4dda-91a0-ebaa5c8de0ce/kanban_projects/jammming-react18

I have completed the project and want to upload my code to GitHub in a public repository so it can form part of my portfolio. However, the code includes my unique client ID for the Spotify API, which shouldn’t be shared.
If I upload the code as is then edit out the client ID, it will still be possible for people to view the ID by looking at previous commits.
I tried copying the folder locally with the intention of just deleting the client ID then uploading to a new public repository (currently it is in a private repo), but then when I tried to initialise I got the error message that the remote origin already exists.

Any ideas of how I can get round this? I still want a working version of my app so don’t want to just edit my current file, but also want to upload a redacted version to GitHub.

Thanks in advance!

You probably want to set something like environment variables. How are you going to host your app?
Github secrets might be the thing you’re looking for Using secrets in GitHub Actions - GitHub Docs

And yes your instinct is right, no private keys, passwords, API Keys, secrets, sensitive data in your repos is the way to go. This is even true for private repos.

From what I’ve read, it’s not possible to host the app because the Spotify API only allows apps that are in development mode to support up to 20 users, so user authentication wouldn’t work after the first 20 people. Shame I can’t deploy it but I’ve done a screen recording of me using it that I’ve saved as a video and shared on my portfolio website. I thought it would be good to have the code viewable on GitHub, too.
I’ve not heard of Github secrets, I’ll check out the link you sent. Thanks!