0

I have some files committed (.idea) that should be in the normal checkout of the git project but then nobody is allowed to update those files further unless intentionally and explitly declaring to do so.

I add the directory to gitignore (/.idea)

But git status keep saying modified file and wants me to commit and push those things in that directory.

I do not want to remove them in the git repo. Only to stop allowing further commits.

Is that possible?

Richard
  • 106,783
  • 21
  • 203
  • 265
mjs
  • 21,431
  • 31
  • 118
  • 200
  • 1
    it's not `/.idea` but `.idea/` – dave-cz Feb 01 '19 at 09:46
  • @dave-cz thanks but I don't see any difference. still asking me to commit modified .idea/workspace.xml – mjs Feb 01 '19 at 09:49
  • relevant discussion: https://gist.github.com/scy/6636390 – mjs Feb 01 '19 at 09:50
  • If you add that directory to gitignore, then new files created in that directory will not be tracked, but if you have a file that is existing in the repository and has been modified, will be reflected when you check the git status. – Code_Ninja Feb 01 '19 at 11:23
  • Possible duplicate of [Can I 'git commit' a file and ignore its content changes?](https://stackoverflow.com/questions/3319479/can-i-git-commit-a-file-and-ignore-its-content-changes) – phd Feb 01 '19 at 13:50
  • @phd awesome!!! – mjs Feb 04 '19 at 12:29

0 Answers0