i've got this problem: got a file under $MYAPP/application/config/database.php that contains all the informations about how to connect to the mysql dbms. Now, these data are different between my local environment and the production environment.
So i've made a .gitignore (under the root of my git project - $MYAPP) that indicates to ignore application/config/database.php file from commits.
Now, on the remote production environment, I modify this file. How is possible that when i make ANY modification to ANY (and not database.php) file, ask for a git status (where database.php is not mentioned), push and on the remote environment I find the same copy of my local environment database.php version? It seems that git is "ignoring my .gitignore file"
Thanks for help Regards.
database.php
already added? Are you committing changes to it? (You can check withgit log --stat
) How is your remote environment being updated? (Normally this is not done by git) – Empressement.gitignore
doesn't mean "ignore" at all. It has instead two different meanings: "shut up about untracked file" (ingit status
output) and "don't auto-add that file when adding 'all' files" (ingit add .
for instance). If the path is already in the index, though, neither of these do anything. See https://mcmap.net/q/11358/-git-ignore-vs-exclude-vs-assume-unchanged for caveats about the standard--assume-unchanged
workaround. – Diakinesis