0

Prior to editing the .gitignore file in a project the following files were displayed when the status was queried:
enter image description here

Wanting to ignore the multiple versions of sandbox Vue files, this was added to the project's .gitignore file at the bottom:

# app files
/src/modules/admin/views/sandbox*.vue

Now when the status is queried the following is displayed:
enter image description here

Why is ../.gitignore being displayed now? What should be changed so that file is not displayed?

knot22
  • 2,648
  • 5
  • 31
  • 51
  • Your filenames solved my multiple years' low blood pressure... – iBug May 07 '21 at 15:36
  • Check out [How do I configure git to ignore some files locally?](https://stackoverflow.com/q/1753070/5958455). Basically you'd put ignore lines *specific to your local clone* inside `.git/info/exclude`, which will not be tracked like `.gitignore`. – iBug May 07 '21 at 15:38
  • Does this answer your question? [How can I stop .gitignore from appearing in the list of untracked files?](https://stackoverflow.com/questions/767147/how-can-i-stop-gitignore-from-appearing-in-the-list-of-untracked-files) – Dev-vruper May 07 '21 at 15:45
  • @Dev-vruper Yes, that thread is helpful. – knot22 May 07 '21 at 15:47
  • Some things aren't intuitive at first, but once you understand them, they become funny. (I hope even OP would agree.) To summarize what happened here: Q: Why is my file showing as modified? A: Because you modified it. ;) – TTT May 08 '21 at 02:47

1 Answers1

2

This means that .gitignore is a tracked file.... so you changed it, so it shows up as changed. This would be the expected result... and it makes sense. Do you want to ignore .gitignore? This is not quite a good idea because by tracking it, everyone gets to ignore the same things in the project. Now, if you would like to be the only person in the project to be ignoring the files that you started the question from, you might have to consider adding that to .git/info/exclude so that it's only on you and no one else.

eftshift0
  • 26,375
  • 3
  • 36
  • 60