Hi, i created repo in github.com and pushed there my project. I coded some things and commited-pushed them. Then i realised i have my firebase credentials in firebase.js file and everyone would see them in github. Now i created .env.local file. Do i need to create new repository now and push actual project with env local or is there some way to edit previous repository and delete my firebase credentials from there?
#Github
1 messages · Page 1 of 1 (latest)
Hi @floral gull If there are minor edits, we can do on the github itself. To edit first open your repo at github.com ,then click on the file that requires editing (like in your case it might be firebase.js )and then there's a pencil picture as shown by the arrow. You can click it and edit.
Alternatively you can make changes(editing files, deleting files, adding new files, etc) in the repo in your local machine and then push it to your repo at github.com
I think you are aware of the issue here, but let's restate it for those for which it might not be obvious: You can not simply remove the file or edit the sensitive information from the file, then commit that change to the repository. This won't work because GitHub tracks the change history of everything, so that sensitive information will always be viewable in the change history for that file.
I think realistically you have two options:
- If you are not concerned with preserving edit history of the entire repository, you could just delete the entire repository and start a brand new one (with the sensitive information removed from the file, of course).
- Otherwise, there are (complex) git commands that will completely cleanse a file from a repository, but you'll have to Google those yourself.
Oh yes I forgot that passwords are still in the previous commit histories