We have a git repository that has a folder in it we would like to untrack, so that:
- The folder is still in our remote directory, but any changes done locally are not shown when running "git status"
- Any new files that are automatically added to the folder are not tracked as well
Looking online we sort of came to the conclusion that if that folder wasn't added to the gitignore when it was created, then adding it to it afterwards simply won't stop tracking the folder. The folder is sort of a program generated folder, but we don't need it to be updated from the remote repo, but would like to still keep it there as it speeds up the process of some things. I've found a few solutions online and saw many people ran
git rm -r --cached <your directory>
which will un-track the folder, but also remove it from my remote repo, which is not what we want. I saw another solution that involved running
git update-index --assume-unchanged /dir/to/untrack
This will print out "Ignoring path dir", but if a new file is created in that folder, it shows up when running "git status". We also tried editing a file that was one directory below the one we set to untrack ( i.e. dir/to/untrack/dir2/changedThisFile.txt ) and that file still shows up when running "git status" too.
Any help or advice would be greatly appreciated.