intern_gitignore_what_why_how.md - brainchildservices/curriculum GitHub Wiki
-
. gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory that aren't useful to other collaborators, such as compilation products, temporary files IDEs create, etc.
-
The .gitignore file is a text file that tells Git which files or folders to ignore in a project.
-
A local .gitignore file is usually placed in the root directory of a project. You can also create a global .gitignore file and any entries in that file will be ignored in all of your Git repositories.
-
To create a local .gitignore file, create a text file and name it .gitignore (remember to include the . at the beginning). Then edit this file as needed. Each new line should list an additional file or folder that you want Git to ignore.
-
The entries in this file can also follow a matching pattern.
- '*' is used as a wildcard match
- / is used to ignore pathnames relative to the .gitignore file
- '#' is used to add comments to a .gitignore file
-
This is an example of what the .gitignore file could look like:
-