Add the previously ignored git files. git add -f doesn't work

I used

git status --ignored 

      

To check which files were ignored as follows:

 git status --ignored
# On branch SIT
# Ignored files:
#   (use "git add -f <file>..." to include in what will be committed)
#
#       web/sites/default/files/

      

So that's fine. But when I use:

git add -f web/sites/default/files/

      

And then use "git status --ignored" again, it shows the same file. Even after adding them to the commit.

+3


source to share


1 answer


You probably need to add the file to this directory instead of adding the directory yourself. To add all the contents of this directory:

git add -f web/sites/default/files/*

      

I had a similar problem, although my problem was caused by the command git update-index --assume-unchanged

I posted earlier without fully understanding it. If anyone comes here for the same reason, I solved my problem by running:



git update-index --no-assume-unchanged <myfile>
git add <myfile>

      

See git-update-index for details .

+1


source







All Articles