5

Does anyone knows how to ignore this file from the repository with .gitignore?

enter image description here

I'm using Gitlab.

I've already tried this:

enter image description here

Thanks in advance

Pedro Tainha
  • 497
  • 2
  • 6
  • 14
  • 2
    This .gitignore line should work, but if you already pushed that kind of files to the remote repo, then you'll have to remove them from the remote, and then it will be ignore – Kapcash Nov 20 '18 at 15:58
  • Thanks a lot, you're right. Shouldn't you answered instead comment (because with answer I could mark as correct your answer) – Pedro Tainha Nov 22 '18 at 11:05

1 Answers1

8

The gitignore line is correct, but git ignores it if some matching files are already pushed to the remote repository. It means the files are in the git index, so it will want to stage them until you remove it from index.

You could try to delete the file from the git index using

git rm --cached npm-debug.log.xxx

See more on this thread :)

Kapcash
  • 6,377
  • 2
  • 18
  • 40