I have several config files that I would like to keep on GitHub but ignore further changes. By ignoring further changes I mean "If anyone clones the repo they will get the default version of those files and can edit those locally but when run git status
those files will not appear."
So what I did/try so far is:
- I add those files and make initial commit/push to GitHub.
- Later add those files to .gitignore and commit again to GitHub. But then when someone clone that repo, those files remain tracked.
So then I tried two options:
git rm --cached . git add . git commit .....`
But in this case a later commit actually deleted those files.
- Tried
git update-index --assume-unchanged [filepath]
and it works but I don't want someone clone the repo and then to run this command. Is there any way without this command I can achieve my goal?