How do I stop sending package-lock.json by gitignore?

Asked

Viewed 3,295 times

5

I can’t "ignore" sending package-lock.json for gitlab, when I run git status it appears to me to be sent. Follow a print showing the .gitignore and my terminal when running git status.

Executando o git status

File . gitignore

Arquivo .gitignore

2 answers

7


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

git rm --cached package-lock.json

Now, if you wish keep up this file in the repository but do not want any new change in it to be committed, you must use the command

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

If you want to re-track changes in it:

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

1

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

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

So git won’t manage anymore.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.