I need to ignore changes, both local and remote, to a directory. For example I have remote git set with:
- templates/T1
- templates/T2
- templates/Tn
And I want to set local git so that it track only T2 for example, and ignore others.
What I tried was this:
git rm -r --cached templates/T1
git rm -r --cached templates/Tn
And then added this to the .gitignore inside of templates dir
/*
!/T2
But after doing this I got bunch of files marked as deleted that want to be pushed to remote, I do not want this. I need remote to keep having all templates, but on this single local machine I need only one template tracked.