← Quiz: Git Config, .gitignore and Hooks: all 10 questions
Quiz: Git Config, .gitignore and Hooks · Question 5 of 10
You added .env to .gitignore, but git status still shows changes to it. Why?
You added .env to .gitignore, but git status still shows changes to it. Why?
- A..gitignore needs a restart of Git
- B.The pattern must be
*.env* - C..env was already committed; .gitignore does not affect tracked files
- D..env files can never be ignored
Answer & explanation
Correct answer: .env was already committed; .gitignore does not affect tracked files
Run git rm --cached .env and commit to stop tracking it.
Can you get the rest right without peeking?
Take the timed Quiz: Git Config, .gitignore and Hooks quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →