Personal Catalogue: PHP & MySQL — Chapter 9, Exercise 1 ==================================================== TASK Create config.example.php with placeholder credentials, add config.php to a real .gitignore file, and confirm (with git status, assuming the project is a Git repository) that config.php genuinely does not appear as a trackable file once .gitignore is in place. SOLUTION 1. Create config.example.php with the placeholder content from the chapter (REPLACE_ME for both $dbUser and $dbPass). 2. Create (or add to) .gitignore in the project root: config.php 3. If the project isn't already a Git repository, initialize one for this exercise: git init git add .gitignore config.example.php git commit -m "Add config template and gitignore" 4. Run: git status Expected output: config.example.php and .gitignore show as tracked (or clean, if just committed), while config.php — assuming it already exists locally with real credentials — does NOT appear anywhere in the output at all, not even under "Untracked files." This is the correct, working behavior: .gitignore causes Git to treat config.php as invisible to status checks and add commands entirely, rather than merely warning about it. A direct confirmation that Git genuinely can't accidentally pick it up: git add config.php Expected: Git either silently does nothing, or (with modern Git) prints a message like "The following paths are ignored by one of your .gitignore files: config.php" and refuses to stage it without an explicit --force flag. WHY THIS WORKS AS AN ANSWER ---------------------------- It verifies the real, checkable outcome — config.php is genuinely absent from git status output and git add actively refuses to stage it — rather than just creating the .gitignore file and assuming it works, since a typo in the filename or path would otherwise fail silently.