I need to exclude dbconfig.php from git repository. How can I remove it from the current indexing in the current repository? Can I exclude it from being added to the repo even when running git add .
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First, remove the file from the index:
git rm --cached dbconfig.phpThen, in the root of the repository, create
.gitignoreand adddbconfig.phpto it.git add .gitignoreandgit commit -m "new gitignore"and it should go missing the next time you do agit statusoradd .