Git not tracking a file from a folder - contents.json from .xcassets Git not tracking a file from a folder - contents.json from .xcassets xcode xcode

Git not tracking a file from a folder - contents.json from .xcassets


A lot of time has passed, but it seems I know what it is. I encountered the same problem, and every time I added resources, I had to manually do the following steps: git add -f

However, I found out about the command: git status --ignoredThe command shows all ignored files. After that, I made the git add -f command manually, and it worked.


Probably you have .xcassets/Contents.json in one or more of the three ignore files .gitignore, .git/info/excludes and ~/.gitexclude.

If that is not the case then try executing below command which will ask Git to start tracking the file again:

git update-index --no-assume-unchanged <file>

For your case:

git update-index --no-assume-unchanged .xcassets/Contents.json