.gitignore not ignoring the files specified. #24023
-
I have updated the .gitignore file with the entry /app/etc/config.php Then i make a change in github directly on this file and do a pull on local system, it downloads this updated file!!! What am i missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
A .gitignore file only affects untracked files that you don’t want to add to the repository. It seems to me that /app/etc/config.php is already tracked in your repository. In that case pushing and pulling changes to it will not be affected by the .gitignore file, see also: https://git-scm.com/docs/gitignore If you didn’t want to add this file to the repository, you can use git rm --cached to remove the file from the index, but keep it around locally. |
Beta Was this translation helpful? Give feedback.
-
Hey Maarid, Make sure that you have added /app/etc/config.php in gitignore after pulling the changes from Github |
Beta Was this translation helpful? Give feedback.
A .gitignore file only affects untracked files that you don’t want to add to the repository.
It seems to me that /app/etc/config.php is already tracked in your repository. In that case pushing and pulling changes to it will not be affected by the .gitignore file, see also: https://git-scm.com/docs/gitignore
If you didn’t want to add this file to the repository, you can use git rm --cached to remove the file from the index, but keep it around locally.