5

I have a node project and I am trying to ignore my package.json.

I have added package.json inside .gitignore.

Basically I am working on creating swimlanes and I have another project's package.json overwritting the existing project's package.json.

What i see happening is the package.json file is overwritting the existing and its not ignoring the new package.json althought its in the .gitignore.

I tried

git rm --cached 

and

git add .

But this is deleteing my package.json file from my local which I dont want

Expected: I need the package.json to be igniored when I pull the new package.json using grunt fetchFromArtifactory.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
cheddarDev
  • 232
  • 1
  • 7
  • 22

1 Answers1

7

If you already are tracking a file, you can't add it to .gitignore. Then git will start to track that file changes.

You can look at this answer to how to tell git to ignore changes in a tracked file.

Community
  • 1
  • 1
Larry Shatzer
  • 3,579
  • 8
  • 29
  • 36