shin shin - 1 year ago 120
Git Question

git .ignore not working in a directory

I have the following .gitignore file

# file named .gitignore


However when I add any changes in config and recapcha.php, git status warns me as following.
When I add any changes to database.php. it does not show it in status

shin@shin-Latitude-E5420:/var/www/myapp$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# modified: modules/recaptcha/config/recaptcha.php
# modified: system/application/config/config.php
no changes added to commit (use "git add" and/or "git commit -a")

How can I fix this?

Thanks in advance.

I am using git version on Ubuntu 11.04

Answer Source

The files are already stored in your local commit tree. You need to remove them from the repository this can be done via git rm --cached system/application/config/config.php modules/recaptcha/config/recaptcha.php after that you need to make one more commit and your good to go.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download