I have a public repository on Github. It’s an online web service. We just want to share source codes of our web service. We are storing all connections datas and functions on connect.php file. And including it to other files, when necessary. We want to hide this file from all visitors except collaborators of repository.
Is it possible? Or are there other way?
What you want to do is stop Git from tracking the file changes.
connect.phpinto a new file calledconfig.phpconfig.phpinconnect.phpgit update-index --assume-unchanged <file>to stop tracking updates to this file.git update-index --no-assume-unchanged <file>