Git adding "unchanged" files to the stage

user2744374 picture user2744374 · Sep 3, 2013 · Viewed 13.9k times · Source

For a project I'm working on, I want to use:

git add . -A

to add some files to the stage. The problem is that Git thinks these files are unchanged from the last commit, so they are ignored. However, I personally changed the file, but Git still sees the file as unchanged.

How can I "forcefully" add that single file to my repository?

Answer

inampaki picture inampaki · Dec 26, 2015

check your .gitignore file there must be some pattern matching this file which is excluding file from being staged. Or you can use git add . -f to forcely add these files.