D
D
Dpy3b2021-11-12 22:13:02
git
Dpy3b, 2021-11-12 22:13:02

How to add files like gulpfile.js, package-lock.json and package.json to .gitignore?

How to add files like gulpfile.js, package-lock.json and package.json to .gitignore?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Kuznetsov, 2021-11-13
@Dpy3b

Such files are added to .gitignore just like any other file.
But I suspect that the issue is different. Do you want the files to disappear from the project?
You see that the file has not disappeared anywhere and concluded that the file has not been added to ignore. But it's not.
In fact , you don't need .gitignore at all, because adding a file to ignore will not automatically remove it from the repository if it has already been added to the tracked ones. This file is needed only so as not to accidentally add too much to the repository. But even it will not prevent us from adding any file to the repo with the git add command file
When you do not want to see the file in the repo, just delete it physically and make a commit.
If the file is needed in the working directory, but you do not want it to shine in the repository, then remove the file only from the index with the command git rm --cached filename and commit it.

V
Vasily Bannikov, 2021-11-12
@vabka

The author of the question wants something strange
. You first remove them from the turnip, and then add them to gitignore

gulpfile.js
package-lock.json
package.json

And commit gitignore

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question