I have a Visual Studio 2019 Solution with multiple projects in it.
In one of the projects (a .net core WebAPI project) I had some credentials in the config files when I added the files to GIT.
Now I would like to get rid of the credentials in GIThub and therefore added files with an “.example” extension.
The plan is that each user can create his local copy of the config files with the credentials in it to do deployment but it shall not be synched back to GITHub anymore.
What I did:
I added “.example” files.
For Web.config I added a Web.config.example
For Web.config.Release I added a Web.config.Release.example
etc...
I added entries into the existing .gitignore file on solution level
# Web.Config
**/WebAPIProject/Web.config
**/WebAPIProject/Web.config.Debug
**/WebAPIProject/Web.config.DEVServer
**/WebAPIProject/Web.config.Release
**/WebAPIProject/Web.config.Test
**/WebAPIProject/Web.config.UAT
I also found some information that I need to make GITHub to remove the files from cache. But here I found multiple different solutions and some claiming the old should not be used anymore, the others claiming the “new” is only temporary.
I do not want to mess up my repository.
In one how-to those commands are listed:
git rm -r --cached .
git add .
git commit -am "Remove ignored files"
But what is the git add . for? And are those still the actual commands for it?
Can someone please let me know the exact commands that I need to execute on the command line?
Thanks in advance.