A
A
Alex102142020-11-19 16:32:10
git
Alex10214, 2020-11-19 16:32:10

How to set folder in gitignore?

Hello. I have a folder "environments" in the project and it stores links and keys. Before that, there were commits with this folder on git. Now I need to add a folder to gitignore, but I don't understand how to do it. I'm a beginner. Tell me please, do I just need to write the name of the folder in dependencies? Or how to implement it at all? I have so much written in gitignore now. I just don't understand where to put it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Sabyanin, 2020-11-21
@EgoSab

The .gitignore file is usually hidden, so look for it in your project.
Then, to specify the name of the folder that you want to exclude from tracking, you need to put the name of the folder or the path to it.
Example
node_modules # Ignore the node_modules
.local folder # Ignore the .local file
someFile.txt # Ignore the someFile.txt file
notes/main_page.txt # Ignore only the main_page.txt file here
*.exe # Ignore all files with permission .exe
Documentation link
For for a deeper understanding, I advise you to read this article

M
Mr_KoTe, 2020-11-25
@Mr_KoTe

In short:
Specify the path of the folder, starting from the folder where .gitignore is.
Assume that the 'environments' folder is in the root (at the beginning of the project folder) and .gitignore is also in the root , then you need to enter the following line:
/environments
The beginner himself is simply , you have to be interested in this)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question