How to block the sending of package-lock.json by gitignore?

1

I'm not able to "ignore" sending package-lock.json to gitlab, when I run git status it appears to be sent to me. Here is a print showing .gitignore and my terminal when running git status.

.gitignorefile

    
asked by anonymous 05.06.2018 / 22:45

2 answers

2

If you want to remove this archive from the repository and make it no longer versioned in it, you need to add it to .gitignore and remove it using the command below:

git rm --cached package-lock.json

Now, if you want to keep this file in the repository but do not want any new changes in it to be committed, you should use

git update-index --assume-unchanged package-lock.json

If you want to re-trace changes to it:

git update-index --no-assume-unchanged package-lock.json
    
25.07.2018 / 14:17
0

I understand that you want the package-lock.json file not to be added to the commit. This way it will also not be sent to the Gitlab repository.

If so, use the command git rm package-lock.json .

So git will not manage more.

    
14.06.2018 / 20:46