Ok, so I inadvertently realised that I had some confidential information in an app I'm developing in .net maui and decided that it was imperative to just delete the repo rather than try and figure out how I could delete history files.
My solution still exists and I'd now like to redo the process of allowing Visual Studio 2022 to recreate the repo on Github with the same name, but as though I was doing this for the first time.
I assume that somehow I have to clear the existing git from wherever Visual Studio has stored it (perhaps because it may republish the history), but I have absolutely no idea how to go about this. Then hopefully VS will allow me to redo the git and publish to Github
Can anyone please provide me with the (hopefully simple) steps I need to go through.
And feel free to tell me that I'm an idiot, but I needed to do what I needed to do :)
Many thanks G
CodePudding user response:
We don't do name calling here, even if you asked for it :)
First of all you probably want to mitigate the spread of your repo that contains the confidential information. Log on to GitHub and make the repo private (if it was public to start with). Make sure no one has forked your repo, if they have then there is no hope to prevent your information getting out.
Ensure you have a local copy of your code.
If you don't care about the repo's history then you can delete the repo completely.
Re-create a new repo on GitHub.
Clone the repo to your local machine.
Copy your code to the local repo excluding the .git folder and confidential information.
Add and commit code.
Push code back to GitHub.
Re-open repo in Visual Studio.
There are probably ways to extract your information out of the existing repo but I'm sure it's long and complicated.