Gitignore things

ive been wonder how gitignore works and for example if you have somthing inside of gitignore will it count twards disc and all that stuff

1 how would you use gitignore and how would you access it since its hidden anyways
2.how would you list a file inside of it it ignore
3. can you list a folder it be ignored and if so how
4. can you exclude files from the ignore kinda like watch.json

Hey @geoffrey1900, gitignore is probably mostly a good place to start learning about .gitignore files, but to answer your questions:

  1. A minimal example can be seen at https://glitch.com/edit/#!/support-assets?path=.gitignore:1:0. That directive tells git to ignore any png files it finds anywhere. As you can see, you can access a .gitignore file in the editor without any difficulty
  2. You can add the file’s full path here and it will be ignored.
  3. add the path of the folder you’d like to ignore and add “/” to it and git will ignore the folder and everything in it (but not a file with the same name)
  4. You can explicitly include a file, even if the folder it’s in has been ignored, by using the ! character before its path

And to answer your initial few questions, putting something in a .gitignore file has nothing to do with disk space except that it won’t add any space to your git repo, which is why files that change very often (like database files or the like) should be ignored.

Thanks but also the link you gave is just forever loading
(It shows nothing in the editor and the file tree is just the loading …)

Hey @geoffrey1900 can you take another look, please?

yeah i works now i think my internet was slow because it was at 2 bars at the time

edit: never mind broken again

another edit: never mind its not lmao

also how would you show the gitignore is it just hidden if it has nothing in it? and how would this apply to other things like the folder .node-modules/

Generally speaking, “dotfiles” (files or directories that start with “.”) are hidden at the filesystem level by Linux. We add special treatment of a few “hidden” files that folks need easy access to - .gitignore and .env are the chief ones. Since we handle that file differently, it should always show up if it’s been added to the project.

Does that clarify things?

ahh yeah ok makes sense