Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

.gitignore not ignoring the files specified.

Solved! Go to Solution.

I have updated the .gitignore file with the entry /app/etc/config.php
Then i pulled this .gitignore file onto my server
Then when i change the app/etc/config.php file and push it to github, it still accepts and pushes it to repository!!!!

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?

 

1 Reply
Solution
Copilot Lvl 3
Message 2 of 2

Re: .gitignore not ignoring the files specified.

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.