I have an existing repository on GitHub that I have around 100 commits to. I want to make it public except for one file that I keep private/remove. This one file contains some database connection strings that I don't want revealed. I've seen other SO posts about how to do this with new repos, but not existing ones. How can I remove the file from the repository or hide it from public view?
Asked
Active
Viewed 39 times
0
-
Possibly the answer in my other comment and the answer in this question https://stackoverflow.com/questions/33864292/how-to-hide-files-and-folders-from-github-public – Schleis Aug 19 '20 at 00:55
-
I did what the first link said, but I get this: https://imgur.com/a/GwQM5nh. What should I do next? – Bubinga Aug 19 '20 at 03:57
-
1You will need to do `git push -f` to force the repository history to be changed. When you removed the files from the old commits, the sha changed. If there are other people working with the repo they may have problems – Schleis Aug 19 '20 at 20:22